Commit Graph
100 Commits
Author SHA1 Message Date
Guldoman 4f434d1a41 Show arrow cursor when hovering DocView scrollbar track 2022-04-12 02:56:41 +02:00
Guldoman 48c371a638 Add scrollbar "track" and resize on hover 2022-04-12 02:56:30 +02:00
Guldoman 052c140787 Fix DocView:on_mouse_released not considering all parameters 2022-04-12 02:38:30 +02:00
Guldoman 202e42b568 Avoid calling View:scrollbar_overlaps_point uselessly
`View:on_mouse_moved` already updated `self.hovered_scrollbar`, so use 
that instead.
2022-04-12 02:37:21 +02:00
Guldoman e5c55e8abc Early break if autocomplete needs to update 2022-04-10 04:20:46 +02:00
Guldoman ffe698cef7 Consider last document line to gather autocomplete symbols 2022-04-10 04:11:59 +02:00
GuldomanandGitHub 50acf2e7e6 Fix keeping scroll position when restoring a DocView (#910)
Since 5526041da3 we check a pair of 
line&column to decide if we should scroll to the cursor.
Previously we only considered a single line&column.
2022-04-03 16:24:39 -04:00
GuldomanandGitHub 3e1fdc4157 Merge pull request #900 from buffet/add-lua-fallback-version
Add minimum version to lua fallback dependency to avoid confusion
2022-03-28 22:33:24 +02:00
Guldoman 46f9be2960 Hide hovered TreeView item when dragging the scrollbar 2022-03-20 04:46:57 +01:00
Guldoman 699655bebf Don't specify delta movement when simulating TreeView:on_mouse_moved 2022-03-20 04:45:14 +01:00
Guldoman 3765ef1d7a Move cursor to the beginning or the end of its selection
When using `doc:move-to-{previous,next}-char` in a selection, we were 
moving the cursor to the character before the initial/after the last 
character of the selection.
Now we follow what other editors do and move it to just before the 
initial/just after the final character.
2022-03-20 04:28:26 +01:00
Guldoman 3ec0f38446 Make treeview:collapse select parent if current item can't collapse 2022-03-18 16:16:55 +01:00
Guldoman 2d5af22dc9 Don't draw treeview tooltip if its position is not defined 2022-03-18 16:10:24 +01:00
Guldomanandjgmdev 000caf2e43 Allow opening non existing files from arguments 2022-03-18 01:09:02 -04:00
Guldomanandjgmdev 9763701cbf Reset syntax when a filename is provided 2022-03-18 00:36:25 -04:00
Guldomanandjgmdev fb4a5f3828 Add command to create a new named Doc 2022-03-18 00:34:15 -04:00
Guldoman 5714da81f8 Always check if the beginning of the text needs to be clipped 2022-03-07 23:35:56 +01:00
Guldoman 240afa7abd Load project module on startup 2022-03-06 21:09:22 +01:00
Guldoman caefc9112a Force syntax patterns starting with ^ to match with the whole line
Before, syntax patterns/regexes that started with `^` didn't have the 
desired effect of matching with the start of the line.

Now those patterns are used only when matching the whole line.
2022-03-04 11:27:01 +01:00
Guldoman fbb893c6b1 Fix ^ regex matching when using an offset
Before, if `offset > 1` was used, the match would have failed because 
the beginning of the string was never met.

Now we force the beginning of the string to be the one specified by the 
offset.
2022-03-03 22:09:48 +01:00
Guldoman 3d879286a4 Use epsilon to compare values in move_towards 2022-03-01 22:41:54 +01:00
Guldoman 539f929e30 Allow intercepting filedropped events
The event is first sent to the underlying `View`; if not handled, it's 
managed as before.
2022-02-15 00:45:59 +01:00
Guldoman 5526041da3 Check entire selection to trigger DocView:scroll_to_make_visible
This is needed for example when a selection has both `line1` and `col1`
at 1, and the left arrow is pressed: `line2` and `col2` change, while
`line1` and `col1` don't, but we still want to scroll.
2022-02-11 06:16:29 +01:00
Guldoman 59ba759167 Don't scroll DocView when executing doc:select-all 2022-02-11 06:00:38 +01:00
Guldoman d4b8155cbc Update process status when calling process:running 2022-02-08 18:10:54 +01:00
Guldoman f23cb33f7c Ignore empty lines in line_comment 2022-02-07 19:22:43 +01:00
Guldoman 9a6cd2b453 Use SDL to manage color format mapping in ren_draw_rect 2022-02-03 01:50:43 +01:00
Guldoman e51c76c72b Assert for negative field in bit32 polyfill
This more closely matches the behavior of lua5.2.
2022-01-12 19:56:09 +01:00
Guldoman 51975472a9 Add bit32 polyfill globally 2022-01-12 00:07:53 +01:00
Guldoman 7eb9908f1a Improve bit32 polyfill 2022-01-12 00:07:14 +01:00
Guldoman d16e46dba5 Update website location 2021-12-23 23:26:52 +01:00
Guldoman a122d7e916 Correct get_key_name comment 2021-12-23 00:06:24 +01:00
Guldoman eac82e69fb Add parameters to core.on_dirmonitor_{modify,delete} 2021-12-22 23:43:56 +01:00
Guldoman 9e7bdf49e9 Revert "Merge pull request #697 from Guldoman/treeview_remove_changed"
This reverts commit 4e078cc217, reversing
changes made to 0c488c9492.
2021-12-22 23:39:26 +01:00
GuldomanandFrancesco Abbate 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
GuldomanandFrancesco Abbate 23f83857c5 Don't search if there are no files 2021-12-20 08:40:43 +01:00
Guldoman 2e9619f630 Directly link to our repo 2021-12-19 18:13:19 +01:00
Guldoman 4cf9d85986 Use new color themes repo 2021-12-19 18:12:34 +01:00
Guldoman 69de42b078 Set void to keyword2 in language_c and language_cpp plugins
Move `void` to the same syntax type used by other data types.
2021-12-15 18:20:17 +01:00
Guldoman 4faaf089ef Consume unmatched character correctly
We must consume the whole UTF-8 character, not just a single byte.
2021-12-11 03:43:33 +01:00
Guldoman c16d6b3d8d Avoid drawing hidden TreeView items 2021-12-07 21:45:20 +01:00
Guldoman fdb29f28cf Split TreeView:draw into multiple functions
This allows plugins to override each aspect of TreeView item drawing.
2021-12-07 21:44:20 +01:00
Guldoman 7cb2068bb8 Split Node and EmptyView from RootView 2021-12-06 22:28:29 +01:00
Guldoman 5029e2ce29 Add name to plain text fallback syntax 2021-12-02 22:34:49 +01:00
Guldoman d7afcb08b1 Check the entire path in TreeView new-file and new-folder commands 2021-11-30 01:11:35 +01:00
Guldoman e500368ce4 Allow TreeView item icon and text styling 2021-11-29 23:36:49 +01:00
Guldoman ef4c02ab0e Check the entire path in TreeView predicate 2021-11-28 07:16:53 +01:00
Guldoman 59f64088e1 Remove changed files/dirs from TreeView cache 2021-11-24 06:16:54 +01:00
Guldoman 5dca37b11a Don't search if there are no files 2021-11-24 05:03:42 +01:00
Guldoman cd2adb4a30 Apply again 1976facaf1
Use reverse search for `find-replace:previous-find`
2021-11-23 22:22:52 +01:00
GuldomanandGitHub 955acf53a3 Merge pull request #673 from vincens2005/master
Add BigInt literal and numeric separators to js syntax highlighter
2021-11-22 22:23:23 +01: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 2de48b6ac8 Adapt detectindent to the new indentation architecture 2021-11-20 04:40:58 +01:00
Guldoman 3d9901695b Use the new Doc:get_indent_info throughout core 2021-11-20 04:37:15 +01:00
Guldoman b77b1c0221 Add Doc:get_indent_info
It returns the indentation type, size and confirmation status, used by 
the `Doc`.
2021-11-20 04:36:58 +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
GuldomanandGitHub 298ec8a1e9 Merge pull request #330 from lite-xl/lineguide-config
remove unecessary string.rep in lineguide
2021-11-17 05:08:14 +01:00
Guldoman 6a7a02542f Draw only visible whitespaces 2021-11-17 02:57:14 +01:00
GuldomanandGitHub 0353d1d435 Merge pull request #651 from obtusedev/master
Add install instructions for prebuilt binaries
2021-11-11 01:18:37 +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 b3eef15e7a Highlight any line that contains a caret
Now lines with selections can be highlighted if they contain a caret.
2021-11-09 21:33:47 +01:00
GuldomanandGitHub 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
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
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
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
Guldoman 780c8c6d0d Improve check for find-replace commands using has_unique_selection 2021-10-16 03:02:42 +02:00
Guldoman ef60b24f63 Check both values returned by Node:get_locked_size 2021-10-16 02:56:01 +02:00
Guldoman 8a516d35ce Correctly identify the start of the next character in tokenizer
When moving to the next character, we have to consider that the current 
one might be multi-byte.
2021-10-11 22:37:31 +02:00
Guldoman 1872e82141 Make regex.match return the appropriate end index
This makes its behavior similar to `string.find`.
2021-10-11 22:32:50 +02:00
Guldoman 038e335c8c Show error message when pcre2_match fails 2021-10-11 22:20:44 +02:00
Guldoman 3a71528087 Allow specifying offset for common.is_utf8_cont 2021-10-11 22:18:02 +02:00
Guldoman 3a1274fd08 Merge reverse find functions for lua patterns and regexes 2021-10-10 01:11:41 +02:00
Guldoman cfe0c79a04 Simplify reverse search
Remove `plain_rfind` optimization.
2021-10-10 01:11:40 +02:00
Guldoman af925d603b Fix doc selection in findreplace
Use `last_view` if `active_view` is `CommandView`.
2021-10-10 01:11:40 +02:00
Guldoman 1976facaf1 Use reverse search for find-replace:previous-find 2021-10-10 01:11:38 +02:00
Guldoman e7be9652c9 Add find-replace:select-previous 2021-10-10 01:10:52 +02:00
Guldoman 56eace627a Add reverse option to search.find 2021-10-10 01:10:47 +02:00
Guldoman db3643653e Sanitize selections after redo 2021-10-02 22:03:52 +02:00
GuldomanandFrancesco Abbate 20ddbd6e9f Load project module on project change (#571) 2021-10-02 18:39:23 +02:00
GuldomanandFrancesco Abbate 57bfb67f6a Add option to disable caret blinking (#572) 2021-10-02 18:39:23 +02:00
GuldomanandFrancesco Abbate 468229e4d0 Small cleanup of scale plugin 2021-10-02 18:39:23 +02:00
GuldomanandFrancesco Abbate f6b9d9ab67 Add option to disable scrolling past the end (#566) 2021-10-02 18:39:22 +02:00
GuldomanandFrancesco Abbate e2f7c984de Reset syntax highlighting on file rename 2021-10-02 18:37:00 +02:00
GuldomanandFrancesco Abbate d817944170 Force showing tabs when dragging them 2021-10-02 18:37:00 +02:00
GuldomanandFrancesco Abbate dced6da03d Implement tab drag and drop 2021-10-02 18:36:59 +02:00
GuldomanandFrancesco Abbate 86632b68de Move single tab drawing to its own function 2021-10-02 18:36:59 +02:00
GuldomanandGitHub bf06aa1c4d Load project module on project change (#571) 2021-10-02 16:38:45 +02:00
GuldomanandGitHub b5f0b340d2 Add option to disable caret blinking (#572) 2021-10-02 16:38:10 +02:00
Guldoman 3b280401e4 Small cleanup of scale plugin 2021-10-02 03:24:35 +02:00
GuldomanandGitHub ab0ca031fa Add option to disable scrolling past the end (#566) 2021-09-30 13:10:38 -07:00
Guldoman 80a6b2245e Reset syntax highlighting on file rename 2021-09-17 23:41:14 +02:00
GuldomanandFrancesco f6b6634868 Force showing tabs when dragging them 2021-09-17 22:25:05 +02:00
GuldomanandFrancesco 3eba7cd7f1 Implement tab drag and drop 2021-09-17 22:25:05 +02:00
GuldomanandFrancesco 6a3f59c423 Move single tab drawing to its own function 2021-09-17 22:25:05 +02:00
GuldomanandFrancesco 66bfff2e26 Fix wrong locked sibling check
Previously if the split type was "hsplit", but `locked_size_x` was 
falsy, `locked_size_y` was wrongly used.
2021-09-15 22:38:09 +02:00
GuldomanandFrancesco 9bfec4aca5 Ensure that the primary node always has a View 2021-09-15 22:38:09 +02:00