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.
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.
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.
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.
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.
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`.
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.
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.
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.
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.
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.
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`.
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.
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
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.
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.