With the new behavior when moving right and triggering a scroll in the
right direction a subsequent movement left do not longer triggers a
scrolling to the left.
The scrolling to the left happens only when needed for the visibility of
the current position.
In other terms with the old behavior the scrolling was purely a function
of the position and was adjusted even when not strictly needed for the
visibility of the cursor.
Now the scrolling is no longer a pure function of the position but it
has a "memory" behavior. The scrolling will be adjusted only if needed
to accommodate the position of the cursor.
Reduce also the width of the margin when the scrolling will be
triggered and calculate as a function of the font character width.
With the modification now Lite behaves like the other editors. In
addition the selection of text with the mouse is much more easy when
a scrolling of the line is needed.
Adapted from contribute rxi/lite-plugins but changed to avoid restarting
the application when switching project.
Current problem:
- the reload of the treeview take some time without any feedback for the
user
Create the user's config init file if lite user's config directory does
not exists.
No longer use the awkward package.searchers but instead add user's
config dir at the end of package path.
It basically works by setting the data directory to
$prefix/share/lite-xl
where $prefix is determined so that $prefix/bin corresponds to EXEDIR.
The packages 'user' and 'user.*' are loaded from the directory
'$HOME/.config/lite-xl'.
The problem was that when the editor had no events the cursor was not
blinking because the event loop was blocking on wait_event.
Now we no longer calls wait_event without a timeout if the windows has
the focus. When the window has the focus the timeout is set to 1 / fps
so that the cursor can blinks.
In addition we react to the "focus lost" event to ensure the documents
are redrawn without the cursor.
To avoid excessive memory usage when opening in a directory with too many files.
Introduce the config variable config.max_project_files to choose the limit.
The mechanism introduced avoid using excessive memory but it fails to
let user access all the files in the directory. A better implementation
should not impose any limits but read each subdirectory on-demand, only
as they are expanded in the tree-view.