Commit Graph

816 Commits

Author SHA1 Message Date
jgmdev e862fe9052 syntax: fix conflicts introduced with #896
* mainly the language_md got affected which has some exotic rules
* some other languages are also using spaces at start of pattern
  and even if not affected this change tackles that
2022-03-28 20:51:09 -04:00
Jefferson González 951f0913da
syntax: add pattern to boost tokenizer performance (#896) 2022-03-25 11:25:32 -04: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
Jefferson González 30de42f4ab
Merge pull request #755 from Jipok/draw_tab_rework
rootview.lua: Refactor Node:draw_tab
2022-03-18 05:05:55 -04:00
Guldoman 000caf2e43 Allow opening non existing files from arguments 2022-03-18 01:09:02 -04:00
Guldoman 9763701cbf Reset syntax when a filename is provided 2022-03-18 00:36:25 -04:00
Guldoman fb4a5f3828 Add command to create a new named Doc 2022-03-18 00:34:15 -04:00
Adam Harrison ba5289dc75 Typo. 2022-03-17 16:57:18 -04:00
Adam Harrison 82325b6a08 Fixed a bunch of problems. Fixed left+click not allowing for square selections, fixed esc not exiting multicursor mode, and allowed cntrl+click to remove a cursor. 2022-03-17 16:55:52 -04:00
Jefferson González 1725a48ce2
Merge pull request #879 from jgmdev/plugins-skip-version
config: added skip_plugins_version
2022-03-11 17:30:36 -04:00
Jefferson González d0d0028472
Merge pull request #877 from jgmdev/statusview-commands
StatusView: added ability to hide and commands
2022-03-11 17:26:02 -04:00
jgmdev 620b669517 statusview: added ability to hide and commands
Also fixed the right panel not been draggable.
2022-03-11 17:23:16 -04:00
jgmdev d9909cf4ea config: added skip_plugins_version
This new config flag ignores the plugins version check at startup
which helps a lot when working on new or old plugins that doesn't match
the mod or lite-xl version and you still desire to load them to fix them
by checking with lite-xl it self which errors need to be corrected.
2022-03-10 22:29:33 -04:00
jgmdev 0aa53a0e7f nagview: support vscroll when message is too long
Also some other minor changes:
* fix transition when nagview is closed
* do not draw or update when not visible
* do not process events when not visible
* cleaned a bit the logic on next and show
* fixes #848
2022-03-10 06:57:16 -04:00
jgmdev eeb2b28a03 config overwritten on user/project modules save
When a user modifies and saves the init.lua or a project module file the
reload_customizations() function was performing unnecessary reloading
of core.config and core.style. This resulted on the replacement of config
tables with new tables, breaking all active references been used by
the consumers of this config options. Been redundant this means
that every consumer was using its own copy of a configuration table
different from the one referenced on core.config and user changes not
taking place.
2022-03-09 02:15:01 -04:00
Adam 960b482061
Fixed some issues with inotify and multiple events at the same time. (#872)
* Fixed some issues with inotify and multiple events at the same time. Seems to be working now.

* Cleaned up and simplified function, and commented, and fixed a number of bugs.

* Simplifying and fixing further.

* Improved performance for skipping large amounts of files.

* Added in extra checks, and changed paths. We should probably unify these path styles.

* Fixed stutter.

* Removed extraneous functions.

* Cleaned up more, added more testing; dealt with multiple sequential events correctly.
2022-03-08 19:30:25 -05:00
jgmdev 9d4e475a2c init: also load default nodes and commands before user plugins and project module. 2022-03-06 21:21:00 -04:00
jgmdev d7d88a2037 init: load core views before user plugins 2022-03-06 21:03:16 -04:00
Guldoman 240afa7abd
Load project module on startup 2022-03-06 21:09:22 +01:00
Adam f85612e0f0
Fix Project Scanning (#746)
Removed dmon, and replaced with logic that works across Linux, Mac, FreeBSD and Windows. Have tested on all platforms, and seems to work.

Co-authored-by: Jan200101 <sentrycraft123@gmail.com>
2022-03-06 00:59:22 -05:00
Jefferson González 0e79607895
Merge pull request #859 from jgmdev/commit-on-version
Add git commit on version of devel builds
2022-03-04 14:18:36 -04: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
jgmdev 1e765b5c28 EmptyView: handle lite-xl version strings that overlap. 2022-03-02 03:55:03 -04:00
Guldoman 3d879286a4
Use epsilon to compare values in `move_towards` 2022-03-01 22:41:54 +01:00
jgmdev e9775ced78 StatusView: added items hovered option for bg color and param to on_draw as suggested by @Guldoman 2022-02-28 17:56:17 -04:00
jgmdev 4c80aa7a40 StatusView: reposition left and right panel offsets on window resize. 2022-02-28 17:04:37 -04:00
jgmdev 15a31418ca StatusView: restored indent confirmed 2022-02-24 14:22:52 -04:00
jgmdev 128e10ba47 StatusView: add spaces as separate items instead of pre-pending them to items. 2022-02-24 13:58:40 -04:00
jgmdev 131bdf9fb2 StatusView: implemented and applied get_item_visible_area. 2022-02-24 02:23:29 -04:00
jgmdev b1ce685489 StatusView: better calculate panel sizes and handle out of bounds drags. 2022-02-24 00:21:21 -04:00
jgmdev c5648e1f02 StatusView: implemented dragging and scrolling. 2022-02-23 19:25:25 -04:00
jgmdev 3452d499e5 Show hand cursor on clickable elements as suggested by @Guldoman 2022-02-23 06:07:53 -04:00
jgmdev 90983b22a4 StatusView v2.0, some changes include:
* Items are now objects that can be retrieved and manipulated.
* clip rect is used for left and right panes
* initial support for items to do their own custom drawing by also
  doing a clip rect for them
* a custom background color can be specified for the item.
* a command or function can be executed on item click.
* Introduced functionality to easily hide or show all or specific items.
* Better handling of deprecated get_items()
* Spacing is automatically added to items and cleaned on deprecated
  items.
* Default items where separated and given the names:
  doc:file, doc:position, doc:indentation, doc:lines,
  doc:line-ending, core.commandview.
* Some default right or left click actions where given to the default
  items.
* Started adding required bits to support dragging to left and right
  panes when some items aren't visible.

Note: should work well enough already but maybe some repetitive stuff can be
cleaned out.
2022-02-23 05:15:14 -04:00
jgmdev 7cb4e93d14 Improvements to the StatusView
* Support for predicates by introducing add_item().
* Support for performing click actions on items.
* Support for optional tooltips on item hover.
* Deprecate the usage of get_item().
2022-02-21 03:40:25 -04:00
Adam 61e712db12
Fixed rendering computations for y offset. (#843)
* Fixed rendering computations for y offset.

* Force monospacing if every ascii character has the same integer advance.

* Added in explanatory comment.

* Fixed issues.

* Made lines less long.
2022-02-15 15:57:07 -05: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
Francesco Abbate b02aae939c Fix again bug with invalid ignore_files patterns
The pattern cannot be tested in advance as it seems that Lua inspect
the pattern only partially, the part that is actually used.

We resort to use pcall to catch any error when using the pattern.
2022-02-11 23:00:15 +01:00
Adam a6f32ca0d0
Merge pull request #822 from AlexSol/update_contextMenu
Travel by contextMenu using keyboard
2022-02-11 12:10:14 -05:00
Adam af6a06bc8b
Merge pull request #832 from jgmdev/autocomplete-update
Update autocomplete with changes needed for latest LSP plugin.
2022-02-11 12:01:35 -05:00
Adam b05a02cb28
Merge pull request #839 from jgmdev/nil-nodes-fix
Fix cases of nil node.
2022-02-11 11:52:43 -05: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
jgmdev bb4569da53 Fix cases of nil node. 2022-02-09 10:40:02 -04:00
Guldoman f23cb33f7c
Ignore empty lines in `line_comment` 2022-02-07 19:22:43 +01:00
jgmdev 6773e85cb8 Update autocomplete with changes needed for latest LSP plugin. 2022-02-03 15:01:39 -04:00
Dheisom Gomes f5e9146b1c Merge branch 'master' of https://github.com/lite-xl/lite-xl into improvements 2022-01-30 15:49:37 -03:00
AlexSol efedbae663 Travel by contextMenu using keyboard 2022-01-29 16:23:00 +02:00
Dheisom Gomes 13adedb23a Go back to `common.match_pattern` and use `table.unpack` directly on function `core.add_thread` 2022-01-28 18:30:19 -03:00
Adam 0a70b13a73
Merge pull request #809 from lite-xl/merge-master-2.0
Merge master 2.0
2022-01-28 14:38:22 -05:00
Dheisom Gomes 22d8f69b5c Error correction getting "unpack" function 2022-01-28 12:13:52 -03:00