Avoid waiting with a finite timeout and wait indefinitely in
dmon thread. When we need to unwatch we send a signal to a special
event meant to wakeup the waiting thread.
Some asserts are placed in case that can effectively occur
so we remove the assertion and we return false. In turn we
adapt the logic accordingly so when false is returned to add
a watch we do not open that directory.
Works correctly and the logic seems sound even if somewhat quirky.
`^%.` match any file of directory whose basename begins with a dot.
`^/node_modules$/"` match a directory named `node_modules` at the project's root.
Note that the final '/' needs to be at the end. The '/' after the '^' needs to be there to trigger
a match of the full path filename so we are sure it is at the root.
PROBLEM: the '/' to trigger full path match could be in a pattern's special expression like:
[^/]
`^%.git$/` match any directory name '.git' anywhere in the project.
`^/%.git$/` match a directory named '.git' only at the project's root.
`^/subprojects/.+/` match any directory in a top-level folder named "subprojects".
`^/build/` match any top level directory whose name begins with "build"
PROBLEM: may be surprising, one may expects it matches only a directory named 'build'. It actually acts like
it was `^/build.*/`.
When changing or opening a project directory do not
take the selected item from suggestion but simply the
entered text as it is.
Otherwise the user may be unable to choose a directory
if the text matches the beginning of suggestion.
Close#791
For special file types like the ones in /dev/ the info
entry's type is neither file neither dir.
We prevent these kind of files from being listed in the
project.
Attempt to fix issue #791.
The logic set with the previous commit for suggest_directory
is similar to the one we use except the previous expression
was false do to operator precedence for "and" versus "or".
With the modification here, when opening a project directory,
we suggest the recently used projects
if the text is equal to dirname(project_dir) + "/" which
happens to be the text the command view is initially set to.
In addition we do the same if text is "". If the condition is
not met we return the suggestions from common.dir_path_suggest to
match the text entered.
Works well on Linux but may not solve the problem on Windows, it
should be tested.
Avoid reloading the core.keymap module when user's config
or project module change.
The reason is the plugins like autocomplete can add keymaps
and the additions from plugins would be lost.
Close issue #793
This reverts commit 0f1b84040d.
The new mechanism to save config.plugins upon user's configuration
reload let us stay compatible with existing plugins.
There was a double error because the config.ignore_files was
used at two differect places in different ways.
Now we apply coherently the original rule to apply
config.ignore_files to the basename of each file or directory.
We no longer use in Lite XL recursive directory monitoring as
it was a source of problems.
To enforce this at compile time we use the preprocessor to
remove the implementation of recursive monitoring for the Linux
implementation only.
It wasn't fine to call core.open_doc without filename argument
and later call Doc:save without providing both the filename and
the absolute filename. It was giving a Doc in an inconsistent
status where self.filename was set but not self.abs_filename.
Added an asset to detect early the problem if ever happens again.
In turn the problem prevented the project's module hook to work if the
file was newly created.
Simplifies and uniformize the logic on the Lua side for the
setting of directories' watches. Now we always use the methods:
systems.watch_dir_add / rm
on all the project's directories at any depth when we are not
in files limit mode.
In files limited mode the functions systems.watch_dir_add/rm are
called only on the expanded folders. The shown_subdir table is also
updated only in files limited mode.
On the C side, using the dmon library, we remove the recursive argument
from the system.watch_dir and we always call it recursively except on
Linux. At the same time the functions:
systems.watch_dir_add / rm
are provided but as dummy functions that does nothing except on Linux
where they work as before to add / remove sub-directories in the inotify
watch.
In this was on the Lua side we always act we if the watches needed to be
set for each sub-directory explicitly, independently of the system.
The important improvement introduced is that we always avoid calling
dmon_watch recursively on Linux. This latter thing is problematic with
inotify and is therefore avoided on Linux.
On the other side we simplifies the logic on the Lua side and remove
conditions based on the OS used.
Only a couple trivial features from meson ~0.50 were being used, and
none of them are really needed:
- configure_file() with the install kwarg has always defaulted to
inferring its value from whether an install_dir was defined. This is
fine, we don't need to set `install: true` in that case. The kwarg was
only even added to meson 0.50 for consistency and to allow
conditionally overriding the file to not install, even when
install_dir is set. This project does not need that feature.
- path building could historically be done with the join_paths()
function. Recent versions of meson (0.49) added cosmetic sugar in the
form of string operator overloading to allow using the division
operator on two strings. By removing this and using the backwards
compatible form, we can support older versions of meson.
- sdl2 dependency lookup with hardcoded config-tool method is very
opinionated about the correct way to look up sdl2, but meson can try
multiple methods if you permit it, and there is no reason to think
that config-tool is the only one that returns correct results.
By removing these features, the minimum can be dropped all the way down
to a version that is available on the oldest supported versions of
Ubuntu (18.04), Debian (oldoldstable / Stretch) and anywhere else of
consequence.
No features of 0.54 are being used, so 0.50 should be perfectly fine.
This drops the minimum requirement down to a version available in the
latest Ubuntu LTS (20.04), which only has 0.53
The NagView takes some actual space in the Y and when it appears
it cause the documents' content to be displaced.
The movement of the documents' content is annoying and should be
avoided so we draw the NagView entirely in overlay mode using defer
draw and we always keep its y size to zero to don't affect the
other application contents.
Changes in project's module required an application restart to work.
Now the project will be re-scanned when the project's module changes.
In addition ensure borderless window config is changed when changed
in user's preferences.
It is not a good practice to keep a reference to the project's
directory object outside of the "core" module itself.
The TreeView was using such a reference in the cache item for each
file or directory entry. Replace the reference to the object with
the absolute name of the project directory.