Commit Graph

64 Commits

Author SHA1 Message Date
Francesco Abbate 36de78d6df Remove calls to reschedule_project_scan 2021-10-03 00:05:33 +02:00
Francesco Abbate 14ca590dc0 Use new dmon version win watch_add/rm
Include changes in dmon not yet merged into master.
2021-10-03 00:04:30 +02:00
Francesco Abbate b7ef9a5609 Fix files limited project with dir monintoring
Changed approach to files limited project. Now we keep into the
top-level dir a list of subdirectories to be shown. When in file
limited mode we will not scan subdirectories unless they are in
the list of shown subdirectories.

With the new mechanism the function get_subdirectory_files always
recurse into subdirectories by default but is able to figure out
to stop recursing into subdirectories for files limited project.

The new mechanism is more robust of the previous one. Now the
rescan of subdirectories is compatible with files limited project.
2021-10-03 00:04:30 +02:00
Francesco Abbate db24dbc3a0 Fix a new things about project rescan
Add a flag core.redraw to force redraw when rescan is done.

Inhibit recursion when files_limit is reached.

Still doesn't work correctly for files limited directories.
2021-10-03 00:04:30 +02:00
Francesco Abbate 019280f2ed Fix several problem with directory update
When scanning a subdirectory on-demand ensure files aready present
are not added twice. Files or directory can be already present due
to dir monitoring create message.

Fix check for ignore files when adding a file to respond to a dir monitor
event to use each part of the file's path.

Fix C function to compare files for treeview placement.
2021-10-03 00:04:29 +02:00
Francesco Abbate 593916ada7 Fix bug with expanding directory when file limited
Introduce a new field in items generated by TreeView:each_item()
to point "dir" to the toplevel directory entry.

In this was we can simplify the code and know if the toplevel
directory is files limited.
2021-10-03 00:04:28 +02:00
Francesco Abbate 7b7dfe8c75 Remove the treeview check for modified files
In the treeview the implementation was checking the files list
to detect if it changed because of a project scan. Since we removed
the project scan we no longer need the check.

Removed the TreeView's self.last table that stores previous files
object by top-level directories.
2021-10-03 00:04:28 +02:00
Francesco Abbate 7aca4e6ba2 Remove the project scan thread
Since the directory monitoring is now basically working we remove the
project scan thread periodically scanning the project directory.

Each project's directory is scanned only once at the beginning when
calling the function `core.add_project_directory` and is updated
incrementally when directory change events are treated.

The config variable `project_scan_rate` is removed as well as the
function `core.reschedule_project_scan`.
2021-10-03 00:04:28 +02:00
Francesco Abbate fe2d0b5237 First integration of dmon for directory monitoring 2021-10-03 00:04:28 +02:00
Francesco Abbate 34983668d8 Normalize to project dir in treeview open
When left-clicking in a TreeView file we use now
core.normalize_to_project_dir to normalize correctly
the file name.
2021-10-02 18:37:01 +02:00
Guldoman e2f7c984de Reset syntax highlighting on file rename 2021-10-02 18:37:00 +02:00
Guldoman 474952645c Fix `treeview:open-in-system` command on Windows
The first argument is the title for the `CMD` window.
2021-09-07 22:33:48 +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
Adam Harrison b6af395fc7 2.0 changelog and modversion updates. 2021-08-17 20:24:44 +02: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
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 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 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
Francesco Abbate d7cc1f9f9d Add plugin verification by version tag 2021-04-06 17:50:46 +02:00
takase1121 5e8444b2b1 rename tooltip_alpha_step to tooltip_alpha_rate 2021-03-20 01:04:07 +00:00
takase1121 93753634f5 set delay to 0.5 and disable animation 2021-03-20 01:03:16 +00:00
takase1121 cdf5b9b9b8 show tooltips only when hovering over text 2021-03-20 00:57:06 +00:00
takase1121 d191e8ee34 prevent rendering tooltip when alpha is 0 2021-03-20 00:28:49 +00:00
Takase 0bb7f21dd7
tooltip enhancements (#114)
Add a delay to show the tooltip and other improvements.
2021-03-18 16:18:36 +01:00
takase1121 1f97805321 normalize tooltip filename to home dir 2021-03-14 03:09:18 +00:00
Takase 13ebb51c38
add tooltips to treeview.lua (#100) 2021-03-13 16:44:40 +01:00
Francesco Abbate 5bf7abf23d Ensure filename are store relative to project directory 2021-03-06 23:36:05 +01:00
Francesco Abbate 4d320c1946 Ensure treeview is large enough to show toolbar 2021-02-27 19:39:56 +01:00
Francesco Abbate 4d734e933c Fix resize behavior of treeview and toolbar
Now toolbarview always compute up-to-date sizes and spacing to adapt to
changes in icon big font.

For treeview and toolbarview revert the goto_size approach to use the
original approach of rxi/lite. In order to make it work when user resizes
dragging the divider we use the view optional method set_target_size().
This latter changes the view's target size instead of changing its size
right away. The size is only changed by the lite's layout and animation
system.

Remove the config.treeview_size variable that was no longer working because
plugins are loaded before the user's config.
2021-02-27 12:13:11 +01:00
Francesco Abbate cbb42d0028 Fix spacing in treeview
Previous setting was not okay with monospaced fonts
2021-02-24 17:50:34 +01:00
Francesco Abbate d18b90ad4f Restore original key binding for trreview toggle 2021-02-16 09:41:03 +01:00
Francesco Abbate c20aff2307 Adding final details for toolbarview plugin 2021-02-15 15:45:56 +01:00
Francesco Abbate ebba21310b Fix treesize toggle command and transition 2021-02-15 12:18:43 +01:00
Francesco Abbate b836c2e1e6 Implement proper layout of toolbar 2021-02-15 00:36:39 +01:00
Francesco Abbate f482ea318a Makes resizable attribute explicit in Node:split() 2021-02-11 16:12:21 +01:00
Francesco Abbate e69d201e1b First preliminary implementation of treeview resize
Works but only cover resize along x.
2021-02-09 18:41:32 +01:00
Francesco Abbate c2cccf0173 Fix conflict in treeview for top directories
Happened if a filename has the same name of a top directory.

It will cause a collision in the string to identify the entry into the cache.
2021-01-19 16:40:00 +01:00
Francesco Abbate fcf763fe9c Fix problem when project directory has a trailing slash 2021-01-10 12:56:15 +01:00
Francesco Abbate 77d65fb3a1 Add scrolling bar to TreeView 2020-12-30 16:15:33 +01:00
Francesco Abbate b91a84eb56 Fix project change and quit versus workspace plugin 2020-12-30 14:31:36 +01:00
Francesco Abbate b0686bbe87 Remove mouse command to remove directory and remap create directory
Create directory is now re-mapped to control+(left click).
2020-12-30 12:00:51 +01:00
Francesco Abbate f2faddbec7 Add command to create a directory in a new category "files"
Use the alt + (left click) is tree view to create a directory and
shift + (middle click) to remove a project directory.
2020-12-30 11:52:26 +01:00
Francesco Abbate ddd56ec615 Add command to remove a directory from the project
In addition directories can be removed with a mouse middle-click in the
tree view pane.
2020-12-28 15:51:16 +01:00
Francesco Abbate c042bfc907 Change project files output to not include a prefix '/' in filename
It make sense to not put the initial '/' in the filename as the name
is relative to the top directory it belongs to.

By removing the the initial '/' in the filename we can re-introduce the
variable

core.project_files

to stay compatible with standard Lite. The project_files variable will
always point to the files table of the first entry of
core.project_directories.
2020-12-28 10:26:27 +01:00
Francesco Abbate e4fa196b33 Finalize add project directory feature 2020-12-27 11:32:52 +01:00