Commit Graph

744 Commits

Author SHA1 Message Date
Adam Harrison 8fda78a77d
Removed erroneously added file. 2021-12-20 21:11:02 +01:00
Adam Harrison 436c496d77
Fixed treeview clicking not being caught. 2021-12-20 21:10:58 +01:00
Guldoman 4f079918c9
Consume unmatched character correctly
We must consume the whole UTF-8 character, not just a single byte.
2021-12-20 20:15:54 +01:00
Guldoman 1944f8b9e5
Split `Node` and `EmptyView` from `RootView` 2021-12-20 20:15:30 +01:00
Francesco Abbate 5b0c420270
Try to fix problem with js syntax of '/=' operator
The operator '/=' was wrongly considered by the js syntax file as the
beginning of a regexp literal.

With this modification we modify the pattern for regexp literals to not
match expressions starting with '/='.

This doesn't seem entirely correct because apparently javascript can accept
regexp literals starting with '/=' but the rule used by the javascript
lexer is not known.
2021-12-20 20:14:12 +01:00
Nightwing 534a822158
Improved Markdown syntax highlighter 2021-12-20 20:13:37 +01:00
Guldoman e1d082c56c
Add name to plain text fallback syntax 2021-12-20 20:12:36 +01:00
Guldoman a0afd077a2
Check the entire path in `TreeView` `new-file` and `new-folder` commands 2021-12-20 20:11:48 +01:00
Guldoman 718ab209f5
Check the entire path in `TreeView` predicate 2021-12-20 20:11:45 +01:00
Adam Harrison b8bda8006b
Used basenames for ignore_files rather than full paths. 2021-12-20 20:08:45 +01:00
Francesco Abbate 5f215ccbd4
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 20:08:10 +01:00
Guldoman b918f248cb
Avoid drawing hidden `TreeView` items 2021-12-20 20:06:30 +01:00
Guldoman 4a05dd1683
Split `TreeView:draw` into multiple functions
This allows plugins to override each aspect of TreeView item drawing.
2021-12-20 20:06:29 +01:00
Guldoman f1defe1d38
Allow `TreeView` item icon and text styling 2021-12-20 20:06:29 +01:00
Guldoman 9073301fd0
Remove changed files/dirs from `TreeView` cache 2021-12-20 20:06:29 +01:00
Joshua Minor fb1df78464
Switched to TreeView:color_for_item(abs_path) 2021-12-20 20:06:28 +01:00
Joshua Minor 9820d5113d
Allow for color overrides in the tree view 2021-12-20 20:06:24 +01:00
Guldoman 1a7304a0ae
Adapt `detectindent` to the new indentation architecture 2021-12-20 19:53:08 +01:00
Guldoman ebc05faf34
Use the new `Doc:get_indent_info` throughout `core` 2021-12-20 19:53:08 +01:00
Guldoman 30d1bb097f
Add `Doc:get_indent_info`
It returns the indentation type, size and confirmation status, used by 
the `Doc`.
2021-12-20 19:53:05 +01:00
cukmekerb 9bc306eb33
JS hex BigInts and hex numeric separators 2021-12-20 19:50:18 +01:00
cukmekerb a65ca7a2fa
add BigInt literal and numeric separators to js syntax highlighter 2021-12-20 19:50:18 +01:00
Adam Harrison c8b2b8c205
Made varaible anonymous. 2021-12-20 19:49:41 +01:00
Adam Harrison 20f0c5ba1e
Made plugin load order deterministic. 2021-12-20 19:49:38 +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
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
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
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 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 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
Francesco Abbate f18ac849fb Fix error introduced with 43fc35d7 2021-10-21 23:18:31 +02:00
Francesco Abbate 43374b036f Fix problem with treeview x resizing
The x size of the treeview plugin cannot really change expect if explicitly
resized.

The call to move_towards for x seems to raise a state where core.redraw is
always set to true and this prevent the application to go idle.

It is seen after the introduction of the dmon directory monitoring but it
is not clear why it wasn't seen before.
2021-10-21 23:18:31 +02:00