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