Commit Graph

43 Commits

Author SHA1 Message Date
Francesco Abbate ef4ad10326 WIP: implement new project commands
Implement commands to load a project from a directory and integrate
the project module within the core modules replacing the workspace
plugin.

Needs polishing but the basic functionalities are there.
2021-05-18 17:20:40 +02:00
Francesco Abbate 19623b908e Fix accidental variable shadowing 2021-05-18 12:57:56 +02:00
Francesco Abbate fd47d646c6 Improve code project filename resolution 2021-05-18 09:15:35 +02:00
Francesco Abbate 0cc87591e6 Accept relative filenames in command find-file
Use name within project entries to resolve filenames in
command find-file.
2021-05-17 23:10:15 +02:00
Francesco Abbate 8571076eb3 Fix commande core:remove-directory 2021-05-14 12:19:24 +02:00
Francesco Abbate 5b15029e14 Let the command open-file open a directory as well 2021-05-13 17:04:58 +02:00
Francesco Abbate 948ce96e0d Fix a few more things about filenames 2021-05-13 14:57:55 +02:00
Francesco Abbate 803d6e0f8d Fix doc opening to use absolute filenames
Now we store doc.filename only and removed doc.abs_filename. The former
doc.filename is always the absolute filename.

We use now the variable core.working_dir to transform relative path into
absolute ones.
2021-05-13 12:07:56 +02:00
Francesco Abbate ac0dba18de WIP implementation of project-based schema
Roughly works but need more work and polishing. The workspace plugin
is temporarily disable waiting to be fixed.

Now the application does no longer 'chdir' into the project directory
and we removed the concept of project's directory (core.project_dir)
and project's files (core.project_files). Instead we have always a
project that can contain zero, one or many directories or files.
No directory is special within a project, there is no longer a concept
of project's directory.

WIP adapting open-file command to open a directory

Crash when adding a file into the project
2021-05-11 19:38:33 +02:00
Francesco Abbate 708c2983ef Create new document if file doesn't exist
If a non-existing file is specified with the command "core:open-file"
a new document is opened with the given filename provided the directory
already exists.

The flag new_file is set to true in the Doc instance.

The file will be actually created only when the "save" command is used.

The document will be marked with the "*" event when no changes are done
to mean that it is a new file and is not yet saved.

The function common.normalize_path now process the .. and . in the
filename. Before was not needed because system.absolute_path already
get rid of them but now we need to have the absolute path of files
that not yet exists so we cannot use system.absolute_path.
2021-05-10 16:44:27 +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
rxi d4284edd5c Replaced system.set_fullscreen with system.set_window_mode
Solves #24
2020-04-07 18:49:11 +01:00
rxi efed38d59c Added system.set_fullscreen() and core:toggle-fullscreen command 2020-03-25 22:44:59 +00:00
rxi d8c4bfa6ba Initial commit 2019-12-28 11:17:56 +00:00