Commit Graph

699 Commits

Author SHA1 Message Date
Francesco Abbate 3ccfb94107 Fix a few things 2021-05-19 11:35:25 +02:00
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 9c83082ce8 Add first commands to load/save projects 2021-05-18 12:58:54 +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 239abe86fb Bring back a simplified workspace plugin
Now it only save one file corresponding to the workspace in use.
2021-05-14 17:48:01 +02:00
Francesco Abbate 8571076eb3 Fix commande core:remove-directory 2021-05-14 12:19:24 +02:00
Francesco Abbate befe837eb2 Fix application start for project-based approach 2021-05-14 10:59:42 +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 b497d3ea13 Remove debug messages from treeview 2021-05-13 14:58:13 +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 ea3a7e81be Fix problem with previous commit
Desastrous problem where core.normalize_path was removing the leading /.
2021-05-10 17:01:14 +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
Francesco Abbate 0ce5680ef2 Remove duplicate normalize_path function
Use the function defined in the "common" module.

Move the check for not-nil filename from common.normalize_path
to core.open_doc. In this latter the filename can be nil if a
new unnamed document is created.
2021-05-10 13:08:39 +02:00
Francesco Abbate 1c6325b40f Merge branch 'master' into 'dev' 2021-05-07 08:25:35 +02:00
Francesco Abbate e58d7600ee Prepare release 1.16.9 2021-05-06 17:08:56 +02:00
tsukanov-as f637dc4db8
Fix creating a new file (#179) 2021-05-06 16:53:46 +02:00
Francesco Abbate 55a6888818 Fix resizing problem for nested nodes
Should fix problem reported in:

https://github.com/drmargarido/TodoTreeView/issues/3
2021-05-06 15:35:40 +02:00
Francesco Abbate f1621192f9 Update build package script for window 2021-05-06 09:36:39 +02:00
Francesco Abbate d9a7d9e5ae Update changelog for 1.16.8 release 2021-05-06 09:32:28 +02:00
Francesco Abbate 4c99a18341 More accurate update rects / show window / present sequence
For the option when we use the SDL_Renderer we change:

- the order of calls to SDL_DestroyTexture/Renderer.
  Reported by valgrind on linux as an error to destroy the
  renderer before the texture.
- the SDL_Renderer and texture are created when the surface is
  initialized before the window is shown

It seems that creating the SDL_Renderer and Texture between the
moment the window was shown and the renderer present was introducing
a flashing blank window because of the time taken to create the
renderer/texture resources.
2021-05-06 09:00:36 +02:00
liquidev b76905e78a
Support for changing fonts per syntax group (#178) 2021-05-05 23:08:10 +02:00
Francesco Abbate 5cef643e02 Introduce new plugin versioning tag mod-version
New plugins should use the version tag:

-- mod-version: 1

The old version tag "-- lite-xl 1.16" will be considerer equivalent
to mod-version 1.
2021-05-05 22:38:29 +02:00
Adam 135dfa6f03
Add a more explicit message in log and config.max_project_files
* Added a line to avoid people going down the rabbit hole that I did.

* Further explanatory text.
2021-05-05 16:00:17 +02:00
Francesco Abbate 9f7f55926b Use home_encode when setting window title to filename 2021-05-05 10:35:19 +02:00
Francesco Abbate d63afe02ed Use string.find only in common.home_encode
Should be slightly more efficient.
2021-05-05 10:34:48 +02:00
Francesco Abbate d8244120e9 Ensure the rencache commands buffer is cleared on restart
Fix issue #176 but it should be tested more thoroughly.
2021-05-05 09:32:24 +02:00
Francesco Abbate 820d520fc3 Store doc's babs_filename without home encoding
This is the way was supposed to be. All the filenames are supposed to be
stored without home encoding, i.e. with explicit paths.

Should fix issue #177 and make PR

https://github.com/franko/lite-xl/pull/174

unneeded.

It may also address issue #174 but would need further verifications.
2021-05-05 08:52:14 +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 fa99d5401e
Update README about macos and retina support 2021-05-02 09:33:58 +02:00
Adam 67ec7e8065
Added in drag and drop capability. (#170) 2021-05-02 09:13:21 +02:00
Francesco Abbate b42d9de0be Prepare 1.16.7 release 2021-05-01 23:18:16 +02:00
Francesco fcbb424f16
Remove the CI badge from readme 2021-05-01 22:56:41 +02:00
Francesco c2775b496c
Use explicit dispatch to trigger CI builds 2021-05-01 22:56:04 +02:00
Adam e4da235f7e
Made it so that you can continue clicking and still select things. (#166) 2021-05-01 22:32:50 +02:00
Adam dd604c1336
Nil check, to avoid issues for files that don't have filenames yet (new files, etc..) (#169) 2021-05-01 22:25:39 +02:00
Adam Harrison b69242312d Changed HTML plugin to have case insensitive matching of script and style tags. 2021-05-01 14:52:39 -04:00
Francesco Abbate 1a05e00fdd Fix detection of user file module
Close #54
2021-05-01 19:27:29 +02:00
Francesco Abbate e6d88909a8 Fix log message about project dir 2021-05-01 19:27:29 +02:00
Francesco Abbate 5766329313 Fix filename problem
Close #163
2021-05-01 19:27:29 +02:00
Francesco Abbate 857807b23a Use ab filename as initial text for open file command 2021-05-01 19:27:29 +02:00
adamharrison 3fe6665b9a
Nested Syntax Highlighting (#160) 2021-05-01 11:45:30 +02:00
Francesco Abbate a72431ace7 Merge branch with support for retina display 2021-04-29 14:15:58 +02:00
Francesco Abbate 3d84fe5488 Make usage of SDL renderer optional 2021-04-29 14:15:24 +02:00
Francesco Abbate cec302c04e github actions: Do not use gcc to compile on Mac OS 2021-04-27 17:49:24 +02:00
Francesco Abbate 7c79105d2f Fix missing scaling for update rects in renderer 2021-04-27 07:29:13 -07:00
Francesco Abbate 9486940082 Update the whole texture with RenderCopy 2021-04-27 15:21:23 +02:00