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.
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.
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
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.
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.
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.
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.
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)