Commit Graph

404 Commits

Author SHA1 Message Date
jgmdev bead59a898 autocomplete: properly replace current partial symbol 2022-09-12 22:41:50 -04:00
Guldoman c25f83da90
Make predicate for some `TreeView` commands stricter
This avoids performing the `treeview:new-folder` command on ctrl + 
double click.
This happens because `ctrl+lclick` (which is the keybinding for 
`treeview:new-folder`) is triggered also by ctrl + double click, which 
isn't captured by anything else.
2022-08-21 20:03:32 +02:00
Jefferson González 76f71b2846
Merge pull request #1098 from Guldoman/PR_command_predicate_params
Allow command predicates to manage parameters, allow overwriting commands
2022-08-16 18:20:30 -04:00
Guldoman 06b9953777
Use `Object:is` instead of direct metatable comparison in `autocomplete` 2022-08-16 22:13:25 +02:00
Guldoman cf29a6a45f
Allow command predicates to manage parameters passed to the commands
When a command is performed with parameters, those are now passed to the
predicate.
The predicate can then return, after the validity boolean, any other
value that will then be passed to the actual command.
If the predicate only returns the validity boolean, the original
parameters are passed through to the actual command.

This allows predicates to manipulate the received parameters, and allows
them to pass the result of an expensive computation to the actual
command, which won't have to recalculate it.

String and table predicates will now also return `core.active_view`.
2022-08-16 22:13:16 +02:00
Ben Larisch a6bbd3c8a9
language_python: add syntax support for async/await 2022-08-16 09:52:46 +02:00
Adam 6ccc5f6dde
Steps to generalize toolbar and treeview. (#1088) 2022-08-09 14:53:30 -04:00
Guldoman d7f9b30d05
`drawwhitespace`: Invalidate cache on indent size change 2022-07-15 06:54:03 +02:00
Cyriaque Skrapits af3e2c971c
`language_python`: Add new patterns (#1074)
* `language_python`:  Add new patterns

This commit provides:
 - multiline comments support;
 - unicode string symbol highlighting;
 - class names as keyword2.
2022-07-13 11:06:42 -04:00
NCarrezDev 7f9287a7e7 [chore]: Delete useless $
follow up on Guldoman's comment
2022-07-13 09:16:32 +02:00
NCarrezDev 030dcc1e62 [chore]: Update syntax
Harmonizing the syntax files
Now inline comment are a single string instead of a table of strings.

-(language_c): Removed whitespaces breaking indent
-(language_html): Removed trailing whitespace
2022-07-06 10:15:44 +02:00
Jefferson González f49fd1b477
Merge pull request #1064 from Guldoman/PR_md_single_math
`language_md`: Limit inline math mode to the current line
2022-07-05 18:01:59 -04:00
Ben Larisch ce0d8b313c
language_python: add syntax support for match-case statement 2022-07-03 15:15:51 +02:00
Guldoman 79dd8779c4
`autocomplete`: Fix "Too many symbols" message when `Doc` has no name
Before, when a `Doc` had no name, an error was thrown.
2022-06-29 05:54:37 +02:00
Guldoman 92c2815aa4
`language_md`: Limit inline math mode to the current line 2022-06-28 20:09:36 +02:00
Guldoman 438ed6984a
`drawwhitespace`: Invalidate cache on font size change 2022-06-25 03:30:33 +02:00
jgmdev d2f9eeea07 renderer fonts: additions and improvements
* Allow passing font options to renderer.font:copy().
* Added renderer.font:get_path()
* Reintroduced set_size() for more faster font size changes
* Swapped copy wiht set_size on scale plugin for better performance
* Use code_font:copy() instead of renderer.font.load() on language_md to
  properly match user font now that font options are supported on copy.
* Added new changes to renderer docs
2022-06-23 18:08:04 -04:00
jgmdev 31d2024283 lineguide: added config spec 2022-06-23 18:07:27 -04:00
Chris 1e91080680
Improve `lineguide` plugin (#1056)
* Add more options to lineguide
* Allow lineguide plugin to load but remain disabled
* Use config.line_limit for default ruler
2022-06-23 15:24:57 -04:00
Katrina Grace beefb16469
language_html: Improve subsyntax highlighting (#1043)
* language_html: Improve subsyntax highlighting

- Adjusted `<script>`/`<style>` tag detection to not break when attributes like `defer` are added
2022-06-22 22:56:41 -04:00
jgmdev e0859e1e39 treeview: scale fallback sizes as pointed out by @Guldoman 2022-06-22 01:35:10 -04:00
jgmdev 7b411c3ea9 treeview: restore ability to disable toolbarview 2022-06-22 00:42:26 -04:00
Guldoman 76c1db97f5
`drawwhitespace`: Use `Docview` vertical line offset 2022-06-20 19:56:53 +02:00
a 8fd00b12cf
Add .cjs and .mjs for js syntax highlighting 2022-06-20 16:12:25 +02:00
jgmdev 173dd3aeb4 plugin treeview: fix crash
When the max_project_files is set to a higher value than the allowed
system maximum file descriptors, and opening a project directory that
causes dirmonitor to open a watch on a lot of files or directories, at
least on MacOSX it causes all system.* file functions to return nil
(for too many opened files) which breaks the project files scan.
2022-06-17 15:35:23 -04:00
Jefferson González 3dadbd3a49
Merge pull request #1038 from takase1121/PR/scale-step-gc
run GC between scale to prevent ram from exploding
2022-06-16 03:04:53 -04:00
Jefferson González 380cfb9a24
Merge pull request #1030 from Guldoman/PR_cache_draw_whitespace
`drawwhitespace`: Cache whitespace location
2022-06-15 21:08:09 -04:00
Guldoman 2d3abd2533
`drawwhitespace`: Invalidate cache on config changes 2022-06-16 00:03:25 +02:00
takase1121 42e0028f1c
run GC between scale to prevent ram from exploding 2022-06-15 22:56:52 +08:00
Guldoman f38723ea46
`drawwhitespace`: Cache whitespace location 2022-06-11 06:30:13 +02:00
Guldoman ed02a55cc1
`language_md`: Add math delimiters 2022-06-10 23:55:41 +02:00
jgmdev 3f206db69a initial documentation for better code completion 2022-06-07 22:09:34 -04:00
Jefferson González 439c27447f
Merge branch 'master' into PR_commandview_options2 2022-06-07 19:03:55 -04:00
Jefferson González 2fc20330a3
Merge pull request #1010 from Guldoman/PR_improve_multiproject_treeview
`TreeView` improvements for multi-project
2022-06-07 18:24:54 -04:00
jgmdev de63574b53 plugin linewrapping: added priority
Since the linewrapping plugin modifies some of the DocView line
calculation and positioning functions we need to make sure of loading it
before other plugins. This way we make sure that plugins that also overwrite
and depend on DocView functionality aren't using the original methods without
the linewrapping changes, which leads to wrong line and column calculations.
2022-06-03 04:13:54 -04:00
jgmdev 5da7467a5c plugin drawwhitespace: return line height on draw_line_text 2022-06-03 03:16:18 -04:00
Guldoman ec58b1f0bd
Add `text` and `select_text` to `CommandView` options 2022-06-02 19:30:51 +02:00
jgmdev 4157dd867c plugin drawwhitespace: added config spec 2022-06-02 00:07:34 -04:00
Jefferson González 59a5839ac9
Merge pull request #908 from Guldoman/PR_improve_whitespace
Improve `drawwhitespace` plugin
2022-06-01 21:59:45 -04:00
Guldoman 730ea0c91b
Make `TreeView` more multi-project-dir aware 2022-06-01 06:58:04 +02:00
Guldoman e94c996a26
Add `TreeView` helper functions to get previous/next item 2022-06-01 06:58:04 +02:00
Jefferson González c09715d0e1
Merge pull request #1004 from Guldoman/PR_commandview_options
Add options table to `CommandView:enter`
2022-05-31 16:38:36 -04:00
jgmdev 2d8a15f3ab plugins: dropped --lite-xl version tag 2022-05-31 16:34:14 -04:00
Guldoman 4f0d45d6ab
Don't check unnamed files in `autoreload` plugin 2022-05-31 01:03:59 +02:00
Jefferson González 7dc069aa8f
Merge pull request #995 from jgmdev/PR/plugins-settings-gui
plugins: added settings gui support
2022-05-30 16:12:49 -04:00
Guldoman 11e27c6fda
Use new `CommandView:enter` options table 2022-05-30 22:08:13 +02:00
Joshua Barretto 86e3f4a690 Made wrapping overflow optional 2022-05-30 17:13:21 +01:00
jgmdev 8bbca7c0b0 plugins: added settings gui support 2022-05-23 17:50:10 -04:00
jgmdev b9bb64a2f0 Merge branch 'master' into master-2.1 2022-05-22 22:26:47 -04:00
jgmdev 26e47f7583 plugin contextmenu: simplify predicate 2022-05-15 17:17:28 -04:00
Adam Harrison daeb2a8e04 Made sure we redrew things, added in a contingency in 'save' for times when we load a non-existent file, and added some checks. 2022-05-15 15:25:02 -04:00
Adam Harrison 5a0d213f3b Changed things over to use dirwatch. 2022-05-15 15:24:44 -04:00
Adam Harrison 20dc101229 As per request from jgmdev, added in ability to show nagview always. 2022-05-15 15:24:28 -04:00
Adam Harrison 173370694e Split out reload functionality to actual document, and added in a thread to check the document, in the cases where it wouldn't be covered by dirwatch. 2022-05-15 15:24:17 -04:00
Adam Harrison d56f4e1ee5 Modified autoreload to use new dirwatch infrastructure, and added in nagview to verify that fs changes don't stomp on our changes, unless you want them to. 2022-05-15 15:23:59 -04:00
Adam 36c4d5d9ed
Autoreload Nagview (#942)
* Modified autoreload to use new dirwatch infrastructure, and added in nagview to verify that fs changes don't stomp on our changes, unless you want them to.

* Split out reload functionality to actual document, and added in a thread to check the document, in the cases where it wouldn't be covered by dirwatch.

* As per request from jgmdev, added in ability to show nagview always.

* Changed things over to use dirwatch.

* Made sure we redrew things, added in a contingency in 'save' for times when we load a non-existent file, and added some checks.
2022-05-15 15:21:26 -04:00
Adam 6229f74ccd
Merge branch 'master' into master-2.1 2022-05-09 21:36:10 -04:00
Adam f1f8a9b3f2 TreeView Changes (#898)
* Change to 1 click as per RFC on discord, with 100% in favour.

* Added in the ability to specify  as a view name, so it doesn't modify the title, and also fixed a bug where if you clicked *over* the amount of times your config says, it wouldn't regsiter.

* Changed plugin to use keymap.
2022-05-09 21:33:22 -04:00
Adam Harrison 2eaba8ab92 Erroneously added padding. 2022-05-04 20:08:08 -04:00
Adam Harrison 09bfb8d869 Updated linewrap and autocomplete to use the new get_line_screen_position which takes a col. 2022-05-04 20:05:41 -04:00
Adam Harrison 8345a04d04 Updated treeview to match convention. 2022-05-03 23:13:49 -04:00
Adam 4934e741b3
TreeView Changes (#898)
* Change to 1 click as per RFC on discord, with 100% in favour.

* Added in the ability to specify  as a view name, so it doesn't modify the title, and also fixed a bug where if you clicked *over* the amount of times your config says, it wouldn't regsiter.

* Changed plugin to use keymap.
2022-04-26 18:29:05 -04:00
Guldoman f42dbb0060
Add animation categories to enable finer transitions control (#941)
* Allow finer control over transitions

* Add categories to transitions
2022-04-25 20:35:35 -04:00
Adam 5df1640595
Merge branch 'master' into master-2.1 2022-04-24 13:42:24 -04:00
Philip Bergwerf 5453a27f91
Add triple single quotes multiline strings to `language_python` 2022-04-18 20:22:25 +02:00
Adam Harrison c112bd8d7c Significantly improved performance of tokenization for larger documents by by default not requiring tokenization. 2022-04-17 13:01:45 -04:00
Guldoman 93b31211cb
Apply `drawwhitespace` plugin only to `DocView`s 2022-04-12 04:05:59 +02:00
Francesco 16fcb2e751
Merge pull request #913 from lite-xl/auto-complete-syntax-symbols
Add syntax symbols for auto-complete
2022-04-11 20:42:17 +02:00
Francesco Abbate d4f84e1aff Add syntax symbols for auto-complete 2022-04-10 10:32:43 +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
Adam Harrison 562e284d04 Fixed some minor issues with linewrapping. 2022-04-03 16:44:02 -04:00
Adam Harrison 11dfb5b1ca Apparenlty these were issues? What? 2022-04-03 16:44:02 -04:00
Adam 3479890ce5 Soft Line Wrapping (#636)
Added in soft line wrapping.
2022-04-03 16:44:02 -04:00
Adam Harrison 45a0382d50 Bumping version numbers. 2022-04-03 16:44:02 -04:00
Guldoman 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
Guldoman c70b5130a9
Improve `drawwhitespace` plugin
Add configuration options to specify:
- characters to substitute and their substitution;
- whether to substitute at the beginning, middle or end of the line;
- the color of the substitution;
- the color for the beginning, middle or end;
- the minimum number of white space to show in the middle.
2022-04-01 18:18:50 +02:00
jgmdev 23bd21a191 language_md: remove extra empty line 2022-03-30 09:30:55 -04: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 61ad6b052e
Merge pull request #895 from jgmdev/PR/c-cpp-fixes-improvements
language_c/cpp: fixes and improvements
2022-03-29 16:20:22 -04:00
jgmdev e74761da95 language_c/cpp: fixes and improvements
* support colorization of function and variables type declarations
* support the macro concatenation operator ##
* support what seems to be new cpp number notation format #'###
* improved uppercase constants matching
2022-03-29 16:16:12 -04:00
jgmdev 5f9d45895d language_md: parenthesis support to numbered bullets 2022-03-28 21:03:59 -04:00
Adam Harrison 3e7a97737e Re-enabled comment cache. 2022-03-22 10:35:44 -04:00
Adam Harrison 17645ba4ec Fixed anonyous syntaxes. 2022-03-22 10:17:42 -04:00
jgmdev bbac4d1560 treeview: add proper predicate for delete command 2022-03-20 01:58:39 -04:00
jgmdev c3bcf68851 treeview: use root_view:get_primary_node().active_view for focus. 2022-03-20 01:05:07 -04:00
jgmdev f0cc973e38 treeview: also handle focus change from mouse and then commandview 2022-03-20 00:53:13 -04:00
Jefferson González ad25216de7
Merge pull request #890 from Guldoman/PR_treeview_fix_scroll
Fix `TreeView` scroll via scrollbar
2022-03-20 00:31:26 -04: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
jgmdev b741c204db treeview: better handle previous view when focus/unfocus from CommandView 2022-03-19 23:10:26 -04:00
jgmdev 3ffabced62 treeview: move delete command to proper predicate 2022-03-19 22:33:41 -04: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
jgmdev a7fc7b4408 treeview: fix crash on tooltip.x been nil 2022-03-18 06:02:48 -04:00
jgmdev e8427ae168 treeview: fixed github merging error 2022-03-18 04:23:32 -04:00
Jefferson González 5a63f6dc2e
Merge pull request #770 from takase1121/treeview-initial-size
add option for treeview initial size
2022-03-18 04:18:56 -04:00
jgmdev 02f6dcc07d treeview: added @AlexSol suggestions
* suggestions included collapse, expand and focus
* also added missing common.merge
* some other minor fixes
2022-03-18 03:57:14 -04:00
takase1121 d5da711b6f add selections in treeview 2022-03-18 03:11:13 -04:00
Jefferson González 1f468fca24
Merge pull request #883 from jgmdev/detectindent-improvements
plugin detectident: fixes and improvements
2022-03-17 18:29:46 -04:00