Commit Graph

53 Commits

Author SHA1 Message Date
Adam f85612e0f0
Fix Project Scanning (#746)
Removed dmon, and replaced with logic that works across Linux, Mac, FreeBSD and Windows. Have tested on all platforms, and seems to work.

Co-authored-by: Jan200101 <sentrycraft123@gmail.com>
2022-03-06 00:59:22 -05:00
Francesco Abbate 656a89c494 Fix checks when opening new project directory 2022-01-09 23:26:11 +01:00
Francesco Abbate 5032e7352e Write an initial project module if not present 2022-01-09 23:26:11 +01:00
Francesco Abbate 1e7075ca9f Do not force choosing project dir to suggestion
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
2022-01-05 23:42:47 +01:00
Francesco Abbate 9929ca9c2d Fix logic with project directories suggestions
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.
2022-01-05 23:21:47 +01:00
Francesco Abbate fd074ff39a Fix problem when opening project's module document
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.
2021-12-30 15:26:40 +01:00
Francesco Abbate 3109263c5d Call dmon_unwatch when changing project
Fix a conspicuous omission to call the dmon_unwatch function
when changing project directory.

This uncovered a bug or a quirk of the dmon library where the watch_ids
can change as a result of calling dmon_unwatch because they are just
indexes on a contiguous array. Use a workaround to always unwatch the
first valid watch_id N times.
2021-12-20 14:42:48 +01:00
Guldoman 6bc4fbb238
Restore `TitleView` only when needed
Before, every time the user came back from fullscreen, the `TitleView` 
was shown regardless of its previous status.
2021-11-09 22:21:45 +01:00
Adam Harrison 5b8c08e93a Missing parentheses. 2021-11-07 17:57:15 -05:00
Adam Harrison 24669293c7 Made it so that we originally start on the parent directory of the current project, but provide a list of recently used projects if on that directory. If a directory separator is added, then everything is as normal. 2021-11-07 17:54:42 -05:00
Francesco Abbate 9c43727ebc Implement directory monitoring using septag/dmon
Use a notification based directory monitoring based on the
septag/dmon lirbary instead of periodically rescan the whole
project's tree.
2021-10-08 21:31:22 +02:00
Francesco Abbate 67d7b894ae Add initial suggestion in open-project-folder 2021-09-07 15:23:41 +02:00
Francesco Abbate 28e8a98ffc Fix error in change-project-folder command 2021-09-07 05:21:45 -07:00
Francesco Abbate f1c004411c Add missing home_encode for change-project-folder 2021-08-28 08:08:53 -07:00
Francesco Abbate a8f4c0c4e5 Set initial text for core:change-project-folder 2021-08-27 15:22:09 +02:00
Adam Harrison 851dc07408 Added in close others, and refactored close all. 2021-08-10 23:14:40 -04:00
Adam Harrison 0777a6f0b8 Merged dev to master. 2021-07-20 14:39:50 -04: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 f17f5a4d6d Fix problem with filenames missing normalization 2021-05-24 15:58:49 +02:00
Adam e43f1b9df9
Unified open and saving style. (#189) 2021-05-17 09:29:51 +02:00
Adam 4c42dd4adc
Do not close command view on open-file is file is invalid or it is a directory
Added in a validation function which fires before submitting a command enter; found it incredibly irritating to try to open something, hit enter, only to be told I'd selected a directory, and then have to go through the whole process again. (#175)
2021-05-05 08:04:51 +02:00
Francesco Abbate 857807b23a Use ab filename as initial text for open file command 2021-05-01 19:27:29 +02:00
adamharrison 2e7817f609
Use the active view's filename when opening a file 2021-04-25 20:58:56 +02:00
Francesco Abbate f7375924ab Make non-borderless mode work 2021-04-12 19:05:30 +02:00
Francesco Abbate 04063ff47e Fix error introduced with commit c0ad86d 2021-03-18 15:46:44 +01:00
Francesco Abbate 6369a7f760 Use tilde expansion when running save-as command 2021-02-16 22:54:00 +01:00
bud cc9aa23340 REMOVE: dont add reload on save hook in core:open-user-module, its automatically done in doc:save() 2021-02-15 22:09:06 +01:00
Francesco Abbate 431bf68e72 Fix missing gome expand in remove-directory command 2021-01-03 23:52:02 +01:00
Francesco Abbate 8d4ba0cb34 Fix behavior when selecting project directories 2021-01-03 15:35:35 +01:00
Francesco Abbate e548a6adb9 Fix directories management to always keep the project's directory 2021-01-03 12:02:07 +01:00
Francesco Abbate 7280ae47ab Fix missing absolute_path call in change-project-folder command 2020-12-30 14:40:03 +01:00
Francesco Abbate b91a84eb56 Fix project change and quit versus workspace plugin 2020-12-30 14:31:36 +01:00
Francesco Abbate ddd56ec615 Add command to remove a directory from the project
In addition directories can be removed with a mouse middle-click in the
tree view pane.
2020-12-28 15:51:16 +01:00
Francesco Abbate c042bfc907 Change project files output to not include a prefix '/' in filename
It make sense to not put the initial '/' in the filename as the name
is relative to the top directory it belongs to.

By removing the the initial '/' in the filename we can re-introduce the
variable

core.project_files

to stay compatible with standard Lite. The project_files variable will
always point to the files table of the first entry of
core.project_directories.
2020-12-28 10:26:27 +01:00
Francesco Abbate 4e260cd03e Add a comment about a possible improvement 2020-12-27 18:33:34 +01:00
Francesco Abbate df74781da8 Fix project search and status view for new add directory feature 2020-12-27 18:28:21 +01:00
Francesco Abbate e4fa196b33 Finalize add project directory feature 2020-12-27 11:32:52 +01:00
Francesco Abbate 9a12d47afd Add HOME directory expansion also for open file command 2020-12-20 00:31:49 +01:00
Francesco Abbate 4401f33c19 Move HOME expand/encode into common module 2020-12-19 23:53:29 +01:00
Francesco Abbate 35c87462a6 Use ~ for HOME directory in folder search 2020-12-19 16:31:42 +01:00
Francesco Abbate 9114148b45 Automatically reload style when saving the project user module 2020-12-10 17:56:53 +01:00
Francesco Abbate 6409b67ea2 Add core:restart function to restart the editor 2020-12-10 12:44:01 +01:00
Francesco Abbate e88adc0567 Move project manager into core init file 2020-12-08 16:57:57 +01:00
Francesco Abbate 3589d7d3c0 First implementation of unix-like data directory
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'.
2020-12-02 00:23:15 +01:00
Francesco Abbate 82dc76dd00 Add recently visited files in the list when using find file command 2020-11-16 23:52:51 +01:00
rxi db8c5ea2aa Renamed core:command/file-finder => core:find-command/file 2020-05-30 09:11:42 +01:00
rxi 4ae0d477c0 Made lite set project dir to CWD; removed core.project_dir
Fixes #100
2020-05-17 17:05:56 +01:00
rxi 5361bfaf9c Added open-[project|user]-module commands, renamed command/file finder commands 2020-05-06 14:48:04 +01:00
rxi 28cdd3cabe Minor cleanup in core.statusview and core.commands.core 2020-05-01 20:17:10 +01:00
rxi c658b6f1ca Removed underscore from start of globals, added VERSION
eg. `_SCALE` => `SCALE`
prevents conflict with lua's own _NAME globals
2020-04-25 09:58:01 +01:00