Commit Graph

152 Commits

Author SHA1 Message Date
Francesco Abbate 4f68f7fd92 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-09-06 09:31:17 +02:00
Guldoman f18629ab64 Avoid exposing `treeview` commands when not usable 2021-09-02 23:19:40 +02:00
Guldoman 167cda23f6 Make open files follow renames 2021-09-02 23:19:40 +02:00
Francesco Abbate e94718c5c4 Bring back min len autocomplete default to 3 2021-08-30 14:35:42 +02:00
Guldoman ab6eac399c Fix crash in project search when project has no files 2021-08-29 11:13:39 +02:00
Francesco Abbate ccba91261d Merge remote-tracking branch 'origin/fix-2.0.1' 2021-08-28 17:37:55 +02:00
Daniel Rocha 2b1c157a36 Refactored minimum scale bug fix code 2021-08-28 16:00:41 +02:00
Daniel Rocha 49ec7c88e8 Fix the additional four spaces to two spaces in the indent 2021-08-28 16:00:41 +02:00
Daniel Rocha dac3a9cba5 Fix minimal scale possible 2021-08-28 16:00:41 +02:00
Daniel Rocha 95e86b040b Refactored minimum scale bug fix code 2021-08-28 13:00:33 +02:00
Daniel Rocha 8335b11273 Fix the additional four spaces to two spaces in the indent 2021-08-28 13:00:33 +02:00
Daniel Rocha e342a017e1 Fix minimal scale possible 2021-08-28 13:00:33 +02:00
Francesco Abbate d46475532f Introduce View objects context property
Used to determine if an instance of the given class should
be closed or not when a project session is terminated.
2021-08-27 23:55:17 +02:00
takase1121 2fec3052ce add context menu options for logview 2021-08-24 11:31:22 +02:00
Adam Harrison b6af395fc7 2.0 changelog and modversion updates. 2021-08-17 20:24:44 +02:00
luarocks 205b52b08a Revert language_lua 2021-08-11 23:33:00 +02:00
luarocks 0bafece6a6 Add textadept theme and correct language_lua just a bit 2021-08-11 23:33:00 +02:00
Francesco Abbate 62bcc6abc2 Fix missing commas in autocomplete module 2021-08-02 10:07:43 +02:00
Adam Harrison 0777a6f0b8 Merged dev to master. 2021-07-20 14:39:50 -04:00
Francesco Abbate 7605b626e8 Add language_cpp plugins
Brought form the 1.16.12 release.

It provides support for C++ using multi-part syntax patterns. Take
the priority over C language plugins for header files.
2021-07-19 08:18:38 +02:00
Adam Harrison 423cd33810 Typo. 2021-07-15 17:58:14 -04:00
Adam Harrison e539310e6d Namespace plugin-specific configuration settings. 2021-07-15 17:58:14 -04:00
jgmdev afa0c175e8 Added delete confirmation using NagView. 2021-07-12 11:41:31 -04:00
jgmdev a4d5622eda Make use of core.reschedule_project_scan() 2021-07-11 23:03:33 -04:00
jgmdev 68459a9199 Added context menu to treeview. 2021-06-28 11:11:49 -04:00
Adam Harrison f9edca712d Added in lineguide to core. 2021-06-21 23:21:07 +02:00
jgmdev e9e1214e59 [plugin/scale] fixed wrong increase and decrease
If the user manually set the desired scale by calling scale.set(1.60)
the scale_level was not set accordingly which meant that later doing
a Scale:Increase/Decrease command yielded incorrect scale amount.
2021-06-17 20:58:22 -04:00
Francesco Abbate 1ad4289e76 Do not try to update topdir folder in treeview
If the directory expanded is a project's top directory
do not attempt to update its content.

Fix again issue #275
2021-06-17 19:07:32 +02:00
Francesco Abbate 4c9083398a Fix error in dirname computation in TreeView
In TreeView:on_mouse_pressed() we need to find the directory a
relative filename belongs to from its absolute filename.
The code was using string.find to locate the relative filename
within the absolute path but in some very specific cases we can
find a pattern which is not the right-most one leading to a
wrong directory name.

Fix the error by adding a loop to make sure we find the right-most
match. The standard Lua library has not a string.rfind to make a
reverse search.

Close #275
2021-06-17 18:23:30 +02:00
Francesco Abbate b39db791f9 Do not duplicate RootView method in contextmenu
The method RootView:on_mouse_pressed was copied in the contextmenu plugin with
a small modification to intercept the mouse clicks of the active view.

This approach is problematic because a relatively large portion of code is
duplicated.

We introduced a function named RootView.on_view_mouse_pressed to let plugins
like contextmenu intercepts mouse clicks in the active area without duplicating
the function RootView:on_mouse_pressed.
2021-06-17 10:22:31 +02:00
Adam Harrison 2fc245eb69 Added in an interface to the scale plugin. 2021-06-14 20:33:15 -04:00
Adam Harrison aed643893e Fixed contextmenu to play nice with dragging nodes. 2021-06-14 09:23:04 -04:00
Francesco Abbate e7d0709828 Fix error in workspace file error reporting 2021-06-08 12:06:54 +02:00
Jefferson González b4896ed69e
[plugin/contextmenu] Append itemsets that where registered. (#258) 2021-06-07 23:29:03 +02:00
takase1121 cd5c64fe8c prevent mouse movement from propagating when context menu is open 2021-06-05 08:51:17 +08:00
takase1121 794cf3813a export context menu 2021-06-05 08:47:32 +08:00
Francesco Abbate c5acd030a1 Do not save log views in session file 2021-06-04 14:42:08 +02:00
Francesco Abbate 29e25a7605 Do not show empty documents when restoring session
When a filename cannot be read when restoring a session do
not create a document. Previous behavior was to create an empty
"unsaved" document.
2021-06-04 14:05:54 +02:00
Francesco b046afccf9
Scale fonts context menu (#246)
* Retrieve scale plugin from lite-plugins

* New implementation of scale plugin and font C API

Introduce two new C API functions, renderer.font.get_size and set_size
respectively to get the font size and to set the size to a new value.

Using these functions we don't need to know the name of the font but
we can just change their size.

Adapt the scale plugin to use the new C API function with minor adaptations
in the logic.

Use smaller step to scale fonts.

Rename font_desc_free function, previous name was misleading as only the cached
resources are freed.

* Add contextmenu plugin from takase

From https://github.com/takase1121/lite-contextmenu

Adapted to show font scaling commands and find/replace commands.

i#	testing.lua

* Fix the cursor flickering with contextmenu

To avoid flickering of the cursor when using the context menu
we add a new function `core.request_cursor` that just take note
of the cursor requested.

The cursor will be actually changed only in root_view:draw() method
only when all the drawing operations are done. This means the cursor
will be changed only once per frame and only the most recent cursor
change request will take effect.

* Remove unneeded scale plugin return functions
2021-06-03 22:49:37 +02:00
Adam 248d70a8ca
Add PCRE to support regular expressions
Use regular expressions instead of Lua patterns for find and replace editor commands.

Syntax files can now use regex or Lua patterns as before keeping backward compatibility for plugins.
2021-06-02 21:27:00 +02:00
Francesco Abbate ee25e3c5f4 Reduce number of used lines in detectindent 2021-05-27 16:25:49 +02:00
Francesco Abbate 0a55b246b5 Use thread in detectindent plugin 2021-05-27 16:25:49 +02:00
Francesco Abbate 10fde6e264 Implement lazy loading of directories
When the number of files in a project directory is above the max
limit switch back to a mechanism to read directory content only
when the corresponding folder is expanded in the treeview.

When the command core:find-file is invoked the command core:open-file
is executed instead because the complete list of the project's
files is not available.

When a project search is done we search through all the files within
the project dir without indexing them.

Address issues #217 #203 #183.
2021-05-26 14:22:10 +02:00
liquidev 78999cabe2
Improved Lua syntax (#201)
* improved Lua syntax

* added some missing cases with number literals
2021-05-20 19:02:40 +02:00
liquidev 86a7037ed9
support for multiple groups in one pattern (#196) 2021-05-19 22:35:28 +02:00
Francesco Abbate 92322986b8 Fix error with previous commit
Error was introduced with PR:

https://github.com/franko/lite-xl/pull/190
2021-05-17 10:16:55 +02:00
Adam 6e08c3321c
Fixed a bug where if detectindent is paired with another plugin that hooks the event, it'll overwrite the other plugin's functions. (#190) 2021-05-17 10:05:08 +02:00
Adam 85d0d684de
Truncated lines longer than 256 characters, and skipped to the relevant portion of the line to reduce slowdown and increase relevancy. (#185) 2021-05-17 09:16:20 +02:00
Adam e54ffc49ea
Added in keyboard shortcuts to the project search module. (#188) 2021-05-17 09:14:46 +02:00
Cukmekerb bd4efa14a2
add `of` keyword to language_js.lua and improve js string syntax highlighting in (#186) 2021-05-17 08:56:21 +02:00