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)
Introduce a new approach that discriminate coordinates in
points and pixels. Now all the logic from the Lua side and in
rencache is to always use points. The coordinates are converted
to pixels only within the renderer, in the file renderer.c.
In this way the application logic does not need to care about the
scaling of the retina displays.
For non-retina display the scaling between points and pixels is
equal to one so nothing will change.
There is nevertheless a change that leak into the Lua side. The
subpixel coordinates are in sub-pixel, not sub-points so they are
scaled by the retina scaling factor. But no change in the code is
required because the subpixel scaling factor take into account the
retina scaling, when present.
Because the retina scaling factor is not know when the application
starts but only when a window is actually available we introduce a
mechanism to render the font with a given scaling factor only from
the renderer when they are needed. We use therefore FontDesc to
describe the font information but without actually rasterizing the
font at a given scale.