Commit Graph

167 Commits

Author SHA1 Message Date
Francesco Abbate 719839d299 Add a limit for very slow filesystems
When adding a directory in a project we check if the filesystem is too
slow. If it is too slow we act as if the projects was files-limited by
the number of files but we show a specific warning.

This solution is not perfect but for very low filesystem it can limit
the problem. Otherwise the application would be totally irresponsive.
2021-10-21 11:07:37 +02:00
Francesco Abbate a0f4ac93e1 Do not use normalize_path when not needed 2021-10-12 16:08:06 +02:00
Francesco Abbate 7dd5699c96 Use dmon events in reload plugin 2021-10-08 23:15:25 +02:00
Francesco Abbate 911a3cee08 Report dmon modify events 2021-10-08 23:13:50 +02:00
Francesco Abbate 9c43727ebc Implement directory monitoring using septag/dmon
Use a notification based directory monitoring based on the
septag/dmon lirbary instead of periodically rescan the whole
project's tree.
2021-10-08 21:31:22 +02:00
Guldoman 20ddbd6e9f Load project module on project change (#571) 2021-10-02 18:39:23 +02:00
Francesco Abbate 04250a206a Add previous find and replace in session 2021-09-09 15:42:16 +02:00
Francesco Abbate fa8b3b33b1 Use hidden suggestions also for replace dialog 2021-09-09 15:42:16 +02:00
Francesco Abbate f85fe102d9 Implement hidden suggestions for find dialog 2021-09-09 15:42:16 +02:00
Francesco Abbate 2b277bb502 Fix problem with -psn argument on macOS 2021-09-07 06:44:15 -07:00
Francesco Abbate 90c721b823 Adopt bigger fonts by default 2021-09-07 15:11:20 +02:00
Guldoman f9c7eeeeb8 Check if session file returned anything 2021-09-07 15:03:00 +02:00
Guldoman 59aa7f0090 Fix absolute path detection in `core.project_absolute_path` 2021-09-07 15:03:00 +02:00
Guldoman d3bd35b577 Use plain `string:find` when matching plugin directories 2021-09-07 15:03:00 +02:00
takase1121 622b162225 add core.get_log() 2021-09-07 14:59:03 +02:00
Francesco Abbate 06252382ec Fix focus problem with NagView with root:close-all
Fix provided by @Guldoman in PR:

https://github.com/lite-xl/lite-xl/pull/419
2021-08-28 00:21:29 +02:00
Francesco Abbate 456f6eda65 Do not use os.exit to exit the application
Properly quit the application by terminating the core.run()
function. Otherwise a BadWindow event was happening when
closing the window.
2021-08-27 00:17:50 +02:00
Francesco Abbate dc501cb41a Fix plugin version check 2021-08-25 23:45:18 +02:00
Adam Harrison b6af395fc7 2.0 changelog and modversion updates. 2021-08-17 20:24:44 +02:00
Adam Harrison 851dc07408 Added in close others, and refactored close all. 2021-08-10 23:14:40 -04:00
Adam 47eaca18d8
Merge branch 'master' into Merged 2021-08-01 14:58:36 -04:00
Francesco Abbate 8103f21991 Only load plugins that are lua files
Before trying to load a plugin or checking its version verify if it
looks like a lua file.

Close issue #349.
2021-07-27 23:18:15 +02:00
Adam Harrison 152fd6c66c Fixed doc, and fixed plugin load. 2021-07-20 15:09:14 -04:00
Adam Harrison 0777a6f0b8 Merged dev to master. 2021-07-20 14:39:50 -04:00
Francesco Abbate e1530c0951 Remove duplicate normalize_path function
Use the function defined in the "common" module.

Move the check for not-nil filename from common.normalize_path
to core.open_doc. In this latter the filename can be nil if a
new unnamed document is created.
2021-07-15 18:01:17 -04:00
Adam Harrison e539310e6d Namespace plugin-specific configuration settings. 2021-07-15 17:58:14 -04:00
jgmdev 1a51dad23c Added Doc:on_close() for plugins 2021-06-20 00:13:07 -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 98164f6d4f
Integrate mkdirp function in common module (#265)
Move the function mkdirp into common to be generally available.

Use the new common.mkdirp from create_user_directory() from
core/init.lua replacing previous parent directory creation code
within the function.

The previous mkdirp function did not work on Windows where
absolute paths starts with a drive letter. The code from
create_user_directory() did not have this problem but was wrong
in the way it was creating the nested directories.

The new implementation in common.mkdirp fix both problems.
2021-06-13 19:50:42 +02:00
Francesco Abbate 752ecd5ece Group mouse move events from C API function
Groups together consecutive mouse move events like done in core.step()
lua function but on the C side.

It does not introduce any meaningful speedup but it theory is more efficient and
simplifies the Lua code.

The simplification of the Lua code alone is enough to justify this change?
2021-06-11 15:00:18 +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
lqdev ea5e9b0ce5 fixed broken Doc:save monkeypatch 2021-06-02 19:11:59 +02:00
Francesco Abbate 4e93eabbac Deprecate core.add_save_hook to override Doc:save
In order to stay simple and closer to the lite's design principles we
deprecate the core.add_save_hook function and the related mechanism.
Instead we now directly override the Doc:save() method.

The method is already overrided from core.init to add the automatic
reloading of style when user's module is saved.

The cleanup is related to the discussion in issue #229.
2021-05-31 09:41:37 +02:00
Francesco Abbate 6d044224c1 Starts maximized only if it was in previous session 2021-05-28 16:35:25 +02:00
redtide 818a7abb0a Avoid to restore window size when maximized (#226) 2021-05-28 08:51:39 +02:00
Francesco Abbate ad7d17caca Use FiraSans regular for UI 2021-05-27 13:49:33 +02:00
Janis-Leuenberger 1394c53dbc
Improve user feedback for big directories (#223) 2021-05-27 08:28:58 +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
Francesco Abbate 739763675e Check the real absolute path of user module
Close issue #212
2021-05-22 23:32:45 +02:00
Francesco Abbate 217360ed31 Switch to FiraSans and JetBrainsMono fonts 2021-05-22 15:09:54 +02:00
Francesco Abbate 5cef643e02 Introduce new plugin versioning tag mod-version
New plugins should use the version tag:

-- mod-version: 1

The old version tag "-- lite-xl 1.16" will be considerer equivalent
to mod-version 1.
2021-05-05 22:38:29 +02:00
Adam 135dfa6f03
Add a more explicit message in log and config.max_project_files
* Added a line to avoid people going down the rabbit hole that I did.

* Further explanatory text.
2021-05-05 16:00:17 +02:00
Francesco Abbate 1a05e00fdd Fix detection of user file module
Close #54
2021-05-01 19:27:29 +02:00
Francesco Abbate e6d88909a8 Fix log message about project dir 2021-05-01 19:27:29 +02:00
Francesco Abbate 5766329313 Fix filename problem
Close #163
2021-05-01 19:27:29 +02:00
lqdev c859498d68 check version in init.lua within directory plugins 2021-04-25 19:14:36 +02:00
lqdev 34e94bb8aa fixed versioning, again 2021-04-25 12:35:00 +02:00
lqdev 5e8e2f54b5 directories should not be loaded 2021-04-25 11:45:08 +02:00
Francesco Abbate 8bcace1d59 Merge remote-tracking branch 'origin/border-less-window' 2021-04-21 08:42:57 +02:00