Commit Graph

1219 Commits

Author SHA1 Message Date
Francesco Abbate f18c6ac790 Merge branch 'master-2.0' into master-luajit-2.0 2021-12-20 15:58:15 +01:00
Francesco Abbate abf6d270df Add entitlements for MacOS to allow JIT
Based on thread:

https://developer.apple.com/forums/thread/132109

but not yet tested.
2021-12-20 15:55:00 +01:00
Francesco Abbate 3109263c5d Call dmon_unwatch when changing project
Fix a conspicuous omission to call the dmon_unwatch function
when changing project directory.

This uncovered a bug or a quirk of the dmon library where the watch_ids
can change as a result of calling dmon_unwatch because they are just
indexes on a contiguous array. Use a workaround to always unwatch the
first valid watch_id N times.
2021-12-20 14:42:48 +01:00
Guldoman 29318be9c7 Consume unmatched character correctly
We must consume the whole UTF-8 character, not just a single byte.
2021-12-20 12:04:20 +01:00
Francesco Abbate 37c00c877a Ensure TreeView cache entry is removed on delete
Address issue:

https://github.com/lite-xl/lite-xl/issues/689

Attempt to provide a more accurate fix to commit:

59f64088e1

For this latter what happens is that any change inside a directory
cause the corresponding entry to be folded in the TreeView.

The new change is more accurate because we remove only the stale
entry corresponding to the delete event and we do not reset the
cache of the parent directory using the modify event.
2021-12-20 11:03:49 +01:00
Francesco Abbate 405bd1c2bd Fix logic in project's file insertion
The function "file_search" in core.init was sometimes giving a wrong index
value, off by one.

The problem happened for example when the entry to search was "less than"
the first entry, the function returned a value of two instead of one as
expected.

The bug was easily observed creating a new directory with a name that comes
as the first in alphabetical order within the project.
2021-12-20 09:05:45 +01:00
Adam Harrison e512c57637 Added an exclusion for lineguide in the commandview. 2021-12-20 08:43:48 +01:00
Guldoman 23f83857c5 Don't search if there are no files 2021-12-20 08:40:43 +01:00
Adam 43a6e21135
Merge pull request #681 from Guldoman/prepopulate_highlighter
Prepopulate highlighter
2021-11-23 15:38:20 -05:00
Adam 9869484ec6
Merge pull request #683 from Guldoman/named_languages
Add names to language plugins
2021-11-22 11:41:49 -05:00
Guldoman 23a0f6ca79
Speed up highlighter notify
Avoid calling `table.{insert,remove}` multiple times, as this causes 
multiple shifts in the `self.lines` table.
2021-11-22 06:23:16 +01:00
Guldoman 3176b467ca
Add names to language plugins 2021-11-21 03:46:43 +01:00
Guldoman d0a2c913f5
Pre-populate the highlighter
This avoids problems with calls to `[insert,remove]_notify` on lines 
that the highlighter has not yet added.
2021-11-20 01:18:37 +01:00
Guldoman f24aa64cd5
Add `soft_reset` to highlighter
This allows clearing the `lines` table without removing entries.
2021-11-20 01:15:13 +01:00
Adam a7bbd3d6f7
Merge pull request #666 from Guldoman/no_restore_title
Restore `TitleView` only when needed
2021-11-14 15:59:26 -05:00
Francesco Abbate 64bc2771c3 Merge branch 'master-2.0.3' 2021-11-12 08:44:16 +01:00
Guldoman 6bc4fbb238
Restore `TitleView` only when needed
Before, every time the user came back from fullscreen, the `TitleView` 
was shown regardless of its previous status.
2021-11-09 22:21:45 +01:00
Guldoman bcfd33a7df
Merge pull request #662 from adamharrison/suggest-directory-fix
Made it so that we originally start on the parent directory of the cu…
2021-11-08 01:03:59 +01:00
Adam Harrison 5b8c08e93a Missing parentheses. 2021-11-07 17:57:15 -05:00
Adam Harrison 24669293c7 Made it so that we originally start on the parent directory of the current project, but provide a list of recently used projects if on that directory. If a directory separator is added, then everything is as normal. 2021-11-07 17:54:42 -05:00
Adam 3b38e7c351
Merge pull request #661 from Guldoman/open_in_right_node
In `TreeView` add `DocView` to the correct `Node`
2021-11-07 17:19:23 -05:00
Guldoman f99afcd29c
In `TreeView` set correct active `View` before opening new `DocView`
Before this, the new `DocView` was always added to the primary `Node`.
With this, it gets added to the last focused `Node`.
2021-11-07 23:12:03 +01:00
Adam 40f698e4bf
Merge pull request #625 from Guldoman/allow_closing_primary
Select a new primary node when closing the current one
2021-11-07 15:10:19 -05:00
Adam b7042fd9f7
Merge pull request #631 from Guldoman/fix_missing_subsyntax
Use `header` to get syntax only when provided
2021-11-07 15:09:50 -05:00
Adam 286183f917
Merge pull request #634 from Guldoman/fix_highlighter_holes
Don't insert `nil` in highlighter lines table
2021-11-04 20:45:03 -04:00
Adam 920982cbe7
Merge pull request #629 from Guldoman/avoid_patterns_search
Use plain search by default in `search.find`
2021-10-31 13:55:30 -04:00
Guldoman 9e721937af
Don't insert `nil` in highlighter lines table
When `highlighter:insert_notify` was called, a hole in the array was 
created.
If another call to `highlighter:insert_notify` happened before the hole 
was filled, a `Position out of bounds` error could have been raised.
2021-10-26 00:12:16 +02:00
Guldoman df665ddc38
Use `header` to get syntax only when provided 2021-10-25 14:06:07 +02:00
Guldoman 92db048e7c
Use plain search by default in `search.find` 2021-10-25 00:18:20 +02:00
Francesco Abbate e68d6016f8 Add skip-subproject option in package script 2021-10-23 08:23:33 -07:00
Francesco Abbate 80d837b05b Fix assert with dmon on directory deleting 2021-10-23 15:47:39 +02:00
Francesco Abbate bc7f25a290 Using a luajit-specific version 2021-10-23 15:47:09 +02:00
Francesco Abbate 4f7d4dfed8 Fix assert with dmon on directory deleting 2021-10-23 15:46:30 +02:00
Francesco Abbate e7fc75d022 Move luajit link args to subproject 2021-10-23 15:22:59 +02:00
Francesco Abbate 17eadef99e Disable build of luajit executable 2021-10-23 15:22:59 +02:00
Francesco Abbate eca6db0d5a Update build config for luajit on macOS 2021-10-23 15:22:59 +02:00
Francesco Abbate 20d2b8c21f Add missing file for lbitlib 2021-10-23 15:22:59 +02:00
Francesco Abbate 78e2eab714 Update wrap version for luajit 2021-10-23 15:22:59 +02:00
Francesco Abbate 09a91d6d0b Fix luajit compatibility for new code
The more recent version of lite-xl use the bit32 library and
the lua_Buffer functions. These function were not implemented
by the minimal compatiblity layer and are now added with this commit.

The code is adapted from:

https://github.com/keplerproject/lua-compat-5.2
2021-10-23 15:22:59 +02:00
Francesco Abbate a76b3a6f0e Fix problem with gmatch on utf8 characters when using luajit 2021-10-23 15:22:59 +02:00
Francesco Abbate fa33768a55 Initial draft of transition to use LuaJIT2 instead of Lua 5.2
There is problem with utf8 expression matching on common.utf8_chars
2021-10-23 15:22:59 +02:00
Francesco Abbate d41aed61c9 Update changelog 2021-10-23 15:16:51 +02:00
Francesco Abbate 5cdd800910 Fix problem checking utf-8 cont at end of string 2021-10-23 15:03:09 +02:00
Francesco Abbate ffb66cefd7 Fix python docstring highlighting
From PR:

https://github.com/lite-xl/lite-xl/pull/624

contributed by @dflock.
2021-10-23 15:01:16 +02:00
Guldoman 331b8e90ec
Select a new primary node when closing the current one
The new primary node can be any non-locked leaf node that isn't already 
primary.
2021-10-23 03:34:24 +02:00
Francesco 6f732f67f9
Merge pull request #612 from Guldoman/fix_regex
Fix regex in tokenizer
2021-10-22 21:44:44 +02:00
Francesco Abbate ddb6196e9e Force project rescan on network filesystems 2021-10-21 23:57:17 +02:00
Francesco Abbate 7bdfcd529e Add a function to detect filesystem type on linux 2021-10-21 23:24:38 +02:00
Francesco Abbate e9c16c4367 Add a limit for very slow filesystems
When adding a directory in a project we check if the filesystem is too
slow. If it is too slow we act as if the projects was files-limited by
the number of files but we show a specific warning.

This solution is not perfect but for very low filesystem it can limit
the problem. Otherwise the application would be totally irresponsive.
2021-10-21 23:18:31 +02:00
Francesco Abbate 167e41de65 Fix problem with treeview keeping the editor busy
Fix a problem introduced when fixing the dirty pixel problem, commit
cb08c5c. The node, when determining the layout was rounding the size
of the fixed-size view. In turns this latter was calling move_towards
to the default_size it wanted. If default_size was non-integer the
value vas never archieved because it was rounded during layout and
move_towars was keeping the editor busy by setting the
core.need_redraw flag.
2021-10-21 23:18:31 +02:00