Commit Graph

828 Commits

Author SHA1 Message Date
Guldoman 9a5f8e72d0
Add `DATADIR` and `USERDIR` explanation in created user module 2022-04-18 21:14:50 +02:00
Adam Harrison d323917538
Added in check in case of nil. 2022-04-15 00:07:20 +02:00
Guldoman 43086a9c24
Fix missing pixel in scrollbar 2022-04-12 03:20:27 +02:00
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
jgmdev b0c005a5ac syntax: remove pattern re-ordering on optimization
* Introduces a flag that syntax writers can turn off named
  space_handling, turning it off means that your syntax will take care
  of handling the excessive amount of spaces that can slow down the
  tokenizer.
* Adds another pattern at the end of every single table that also
  improves tokenizer performance by matching words that weren't match by
  any of the synxtax patterns.
* Modifies language_md to turn off the provided space_handling and do its
  own since it has rules that require a space at the beginning, also
  handles long consecutives amount of dashes used in tables that degrade
  performance.
* This changes where discussed in collaboration with @Guldoman and
  @takase1121 thanks to all!
2022-03-29 22:11:14 -04:00
Jefferson González 7372d2f82d
Merge pull request #906 from jgmdev/PR/temp-file-other-dir
core: fixes and changes to temp files
2022-03-29 16:33:08 -04:00
Jefferson González aca1cd6b6b
Merge pull request #892 from jgmdev/PR/status-view-move-item
statusview: added functions for easy custom item ordering
2022-03-29 16:25:31 -04:00
jgmdev ca37644aa9 core: fixes and changes to temp files
* fix delete_temp_files() deleting in EXEDIR but temp_filename() was
  creating temp files in USERDIR
* make delete_temp_files() public so it can be used by plugins
* add optional `dir` parameter to both delete_temp_files() and
  temp_filename() to allow specifying a different directory, this is
  for example useful when generting markdown previews, the temp file
  should be generated in the project dir in case the readme references
  images that are relative to it, so the web browser can find them.
2022-03-28 22:36:49 -04:00
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
jgmdev c82d6b08d9 statusview: added functions for easy custom item ordering 2022-03-21 18:40:14 -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