Commit Graph

72 Commits

Author SHA1 Message Date
Francesco Abbate fb1e08840e Merge branch 'dmon-1' into dmon-debug 2021-09-30 14:24:50 -07:00
Francesco Abbate 991b014a5f Remove calls to reschedule_project_scan 2021-09-29 22:16:44 +02:00
Francesco Abbate 4e58e8be28 Use new dmon version win watch_add/rm
Include changes in dmon not yet merged into master.
2021-09-29 14:08:05 +02:00
Francesco Abbate 2e59aaad3e 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-09-29 14:08:05 +02:00
Francesco Abbate 5a5fc04da4 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-09-29 14:08:05 +02:00
Francesco Abbate aa37f2b149 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-09-29 14:08:04 +02:00
Francesco Abbate ad7bdeb129 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-09-29 14:08:04 +02:00
Francesco Abbate 0d1bec8e35 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-09-29 14:08:04 +02:00
Francesco Abbate 7ee00c3317 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-09-29 14:08:04 +02:00
Francesco Abbate 1ba385eb5e First integration of dmon for directory monitoring 2021-09-29 14:07:34 +02:00
Francesco Abbate 5c4bfd9a77 Remove files from project list when collapsed
Only in limited files mode. We now symmetrically add the files if
a folder is expanded and remove them if it is collapsed.
2021-09-26 22:45:00 +02:00
Guldoman 0a36e66aba Fix `treeview:open-in-system` command on Windows
The first argument is the title for the `CMD` window.
2021-09-07 22:35:56 +02:00
Guldoman 3278eebdad Avoid exposing `treeview` commands when not usable 2021-09-07 15:03:00 +02:00
Guldoman 9887dd4746 Make open files follow renames 2021-09-07 15:03:00 +02:00
Adam Harrison b6af395fc7 2.0 changelog and modversion updates. 2021-08-17 20:24:44 +02:00
Francesco Abbate 26873d59a3 DEBUG: more debug messages 2021-07-25 20:57:54 +02:00
Francesco Abbate 219b2a1d5c 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-07-25 20:49:35 +02:00
Francesco Abbate 45a6c22b18 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-07-25 15:16:01 +02:00
Adam Harrison e539310e6d Namespace plugin-specific configuration settings. 2021-07-15 17:58:14 -04:00
Francesco Abbate 8e7d3c0f66 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-07-15 18:49:18 +02:00
Francesco Abbate d3c7a43a60 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-07-15 12:17:18 +02:00
Francesco Abbate 3e6b9fedfe 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-07-14 23:15:05 +02:00
Francesco Abbate fb1f4af7d5 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-07-14 23:03:52 +02:00
Francesco Abbate b2affddf32 WIP: advance implementation bot not yet complete
Now we request a watch on the directory and we manage sending
and receiving directory change events.

The mechanism to update on the fly the directory scan is not complete.
The code to remove a file is there but we need to implement the code
to add a new file.
2021-07-13 17:40:26 +02: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