Commit Graph

23 Commits

Author SHA1 Message Date
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
tsukanov-as f637dc4db8
Fix creating a new file (#179) 2021-05-06 16:53:46 +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
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
Francesco Abbate 5766329313 Fix filename problem
Close #163
2021-05-01 19:27:29 +02:00
Francesco Abbate 5bf7abf23d Ensure filename are store relative to project directory 2021-03-06 23:36:05 +01:00
Francesco Abbate 1ce1c114ba Fix reload module problem on windows 2021-02-17 19:20:00 +01:00
Francesco Abbate 6369a7f760 Use tilde expansion when running save-as command 2021-02-16 22:54:00 +01:00
Francesco Abbate fcf763fe9c Fix problem when project directory has a trailing slash 2021-01-10 12:56:15 +01:00
Francesco Abbate 8d4ba0cb34 Fix behavior when selecting project directories 2021-01-03 15:35:35 +01:00
Francesco Abbate 0e263af3c6 Create common.serialize function 2020-12-30 13:32:25 +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 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 a3adfeb8f6 Begin reworks of project manager 2020-12-07 18:06:58 +01:00
rxi 95bdb07d49 Removed unused variables 2020-05-07 22:40:34 +01:00
rxi ae42176953 Renamed `common.matches_pattern` => `common.match_pattern` 2020-05-07 14:18:46 +01:00
rxi 3057786ce2 Moved `matches_pattern` from `syntax` to `common` 2020-05-07 10:27:37 +01:00
rxi 05ca43e637 Changed rounding type on common.draw_text() 2020-05-03 16:48:35 +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 59881f81a6 Fixed common.path_suggest() for system.list_dir() changes 2020-04-21 23:47:01 +01:00
rxi d8c4bfa6ba Initial commit 2019-12-28 11:17:56 +00:00