Commit Graph

903 Commits

Author SHA1 Message Date
Takase 130b29438a
Allow creation of nested directories (#254)
* allow nested directories to be created

* fix / be turned into //

* refactor error handling

* refactor path splitting and mkdir calls

If a path exists it will now return immediately.

* fix typo

* remove possible trailing empty string

* fix bugs with path check
2021-06-07 22:44:35 +02:00
Adam Harrison 2170ab9649 Apologies for the subpar previous commit. This fixes the bugs in that one. 2021-06-05 00:50:25 -04:00
Adam Harrison 090d67f252 Exposed indent function, and made it more flexible. 2021-06-05 00:44:35 -04:00
Adam Harrison 3b816a2b4a Changed regex error handling, so that errors can be handled gracefully in lua, and made it so gsub returns the exact matches and replacements. 2021-06-04 23:58:17 -04:00
takase1121 cd5c64fe8c prevent mouse movement from propagating when context menu is open 2021-06-05 08:51:17 +08:00
takase1121 794cf3813a export context menu 2021-06-05 08:47:32 +08:00
Francesco Abbate c5acd030a1 Do not save log views in session file 2021-06-04 14:42:08 +02:00
Francesco Abbate 29e25a7605 Do not show empty documents when restoring session
When a filename cannot be read when restoring a session do
not create a document. Previous behavior was to create an empty
"unsaved" document.
2021-06-04 14:05:54 +02:00
Francesco b046afccf9
Scale fonts context menu (#246)
* Retrieve scale plugin from lite-plugins

* New implementation of scale plugin and font C API

Introduce two new C API functions, renderer.font.get_size and set_size
respectively to get the font size and to set the size to a new value.

Using these functions we don't need to know the name of the font but
we can just change their size.

Adapt the scale plugin to use the new C API function with minor adaptations
in the logic.

Use smaller step to scale fonts.

Rename font_desc_free function, previous name was misleading as only the cached
resources are freed.

* Add contextmenu plugin from takase

From https://github.com/takase1121/lite-contextmenu

Adapted to show font scaling commands and find/replace commands.

i#	testing.lua

* Fix the cursor flickering with contextmenu

To avoid flickering of the cursor when using the context menu
we add a new function `core.request_cursor` that just take note
of the cursor requested.

The cursor will be actually changed only in root_view:draw() method
only when all the drawing operations are done. This means the cursor
will be changed only once per frame and only the most recent cursor
change request will take effect.

* Remove unneeded scale plugin return functions
2021-06-03 22:49:37 +02:00
Ferdinand Prantl d0adb748a6
Flush the SDL_QUIT event when Cmd+W is detected in SDL_KEYDOWN as well (#248)
On macos 11.2.3 with sdl 2.0.14 the keyup handler for cmd+w was not
enough. Maybe the quit event started to be triggered from the keydown
handler? In any case, flushing the quit event there too helped.
2021-06-03 22:14:50 +02:00
Ferdinand Prantl 1eabf99054
Enable lite-xl to be started from a symlink to the deployed binary (#249)
Use resolved executablePath instead of resourcePath to allow lanching
the lite-xl binary via a symlink, like typically done by Homebrew:

/usr/local/bin/lite-xl -> /Applications/lite-xl.app/Contents/MacOS/lite-xl

The resourcePath returns /usr/local in this case instead of
/Applications/lite-xl.app/Contents/Resources, which makes later
access to the resource files fail. Resolving the symlink to the
executable and then the relative path to the expected directory
Resources is a workaround for starting the application from both
the launcher directly and the command line via the symlink.
2021-06-03 21:48:15 +02:00
Tommi Jalkanen f23419994d
Fix: broken build-packages.sh (#251)
Previous commit changed the locations of certain documentation files
causing the meson build to fail.
2021-06-03 21:43:09 +02:00
Adam a128790112
Update README.md
Changed invite link to be permanent.
2021-06-03 15:23:54 -04:00
redtide 8c1a25100c
Moved documentation to the website repository, updated README (#247) 2021-06-03 18:57:26 +02:00
Adam 248d70a8ca
Add PCRE to support regular expressions
Use regular expressions instead of Lua patterns for find and replace editor commands.

Syntax files can now use regex or Lua patterns as before keeping backward compatibility for plugins.
2021-06-02 21:27:00 +02:00
lqdev ea5e9b0ce5 fixed broken Doc:save monkeypatch 2021-06-02 19:11:59 +02:00
Francesco Abbate 4e93eabbac Deprecate core.add_save_hook to override Doc:save
In order to stay simple and closer to the lite's design principles we
deprecate the core.add_save_hook function and the related mechanism.
Instead we now directly override the Doc:save() method.

The method is already overrided from core.init to add the automatic
reloading of style when user's module is saved.

The cleanup is related to the discussion in issue #229.
2021-05-31 09:41:37 +02:00
Francesco Abbate 6d044224c1 Starts maximized only if it was in previous session 2021-05-28 16:35:25 +02:00
Francesco Abbate f7e3e41ab1 Fix problem with mouse cursor over dividers 2021-05-28 15:35:46 +02:00
redtide 818a7abb0a Avoid to restore window size when maximized (#226) 2021-05-28 08:51:39 +02:00
Adam 4ffb5e3672
Fixed commenting and uncommenting. (#224) 2021-05-28 08:17:49 +02:00
Francesco Abbate 34e38dd04a Fix missing check for filename when saving a file
Close #225
2021-05-27 18:53:31 +02:00
Francesco Abbate ee25e3c5f4 Reduce number of used lines in detectindent 2021-05-27 16:25:49 +02:00
Francesco Abbate 0a55b246b5 Use thread in detectindent plugin 2021-05-27 16:25:49 +02:00
Francesco Abbate ad7d17caca Use FiraSans regular for UI 2021-05-27 13:49:33 +02:00
Francesco Abbate fe828b6ed9 Update changelog and release number 2021-05-27 13:46:51 +02:00
Francesco Abbate 934f12cded Fix bug with titleview close button not working
The bug was actually due to a presence of a ghost tab scrolling button
in all the views.

We need to check if the node has multiple views, if not there are no tabs
and therefore no scrolling button areas so we return nothing from the
method Node:get_scroll_button_index().

Close #216
2021-05-27 09:02:19 +02:00
Janis-Leuenberger 1394c53dbc
Improve user feedback for big directories (#223) 2021-05-27 08:28:58 +02:00
Adam Harrison f1a4bf8218 Changed to multiline select. 2021-05-26 17:52:01 -04:00
liquidev cb610055d0
support for font changing in the syntax highlighter 2021-05-26 19:16:56 +02:00
Francesco Abbate 10fde6e264 Implement lazy loading of directories
When the number of files in a project directory is above the max
limit switch back to a mechanism to read directory content only
when the corresponding folder is expanded in the treeview.

When the command core:find-file is invoked the command core:open-file
is executed instead because the complete list of the project's
files is not available.

When a project search is done we search through all the files within
the project dir without indexing them.

Address issues #217 #203 #183.
2021-05-26 14:22:10 +02:00
Adam Harrison 8acb3fae8c Fixed minor error that occurs when saving as after viewing a non-doc tab. 2021-05-24 17:26:16 -04:00
Francesco Abbate f17f5a4d6d Fix problem with filenames missing normalization 2021-05-24 15:58:49 +02:00
Francesco 3634c212a9
Add macos access request for Downloads folder
Close #203
2021-05-23 15:23:04 +02:00
Francesco Abbate 739763675e Check the real absolute path of user module
Close issue #212
2021-05-22 23:32:45 +02:00
Francesco Abbate 81e8c8a223 Fix typo 2021-05-22 23:31:49 +02:00
Francesco Abbate df3e1157d0 Add NSDocumentsFolderUsageDescription in info.plist
Related to issue #203.

Add also NSDesktopFolderUsageDescription.
2021-05-22 18:03:30 +02:00
Francesco Abbate bbc3ea4104 Update copyright and version info info.plist 2021-05-22 18:02:58 +02:00
Francesco Abbate 217360ed31 Switch to FiraSans and JetBrainsMono fonts 2021-05-22 15:09:54 +02:00
Adam a254d393db
Indent Enhancements (#202)
* Indent enhancements.

* Fixed to match style guidelines.

* Added in useful explanatory comment.

* Changed which selection we're using, as we don't want this kind of wrapping to happen.

* Fixed bug involving lines full of whitespace.

* Removed unecessary commit.

* Actually reverted function, so that we don't screw up commenting.

* Fixed hard tab issue.
2021-05-22 15:01:19 +02:00
Alexandr "Nil" Shchelov 04c7a49d00
Link to release page for MacOS section of building (#207)
This should help those who aren't familiar w/ GitHub's UI and who missed the "Get Lite XL" link at the top of the README.
2021-05-22 14:57:18 +02:00
Francesco Abbate abc69a7a19 Prepare release 1.16.10 2021-05-22 14:55:58 +02:00
Adam 50f6ebe8ee
Merge pull request #206 from adamharrison/FixingMacMesonBuild
Fixed meson build on Mac.
2021-05-21 21:30:28 -04:00
Francesco Abbate aa0b2bb5fc Fix crash problem with rencache and font access
In some cases rencache was using a FontDesc pointer that was actually freed by
Lua giving segfaults errors.

In addition, some FontDesc object were not freed in some cases if the
rencache_end_frame was not called when performing the "restart" command.

The invalid access problem can happen because rencache keep some pointers to
FontDesc object but these are Lua userdata that Lua can dispose of. This
situation is prone to hard errors and we should avoid to keep pointers to
objects managed by Lua.

To this purpose we use luaL_ref/unref to bind the FontDesc into the Lua's
registry while rencache need them. We still keeps pointer to FontDesc object but
using luaL_ref we are assured they will not be disposed by Lua.

Since we are using luaL_ref/unref to inform the GC about when the objects are in
use we can now finalize the objects directly when Lua collects them. Previously
the GC metamethods was issuing a FREE command to rencache and the font was
actually freed only from the rencache_end_frame function.
2021-05-21 23:38:54 +02:00
Adam Harrison 3a5f04fae5 Spelling mistkae. 2021-05-21 16:32:26 -04:00
Adam Harrison 18fe6576d8 Fixed meson build on Mac. 2021-05-21 16:31:31 -04:00
Adam 949692860e
Tokenizer cleanup (#198)
* Cleaned up tokenizer to make subsyntax operations more clear.

* Explanatory comments.

* Made it so push_subsyntax could be safely called elsewhere.

* Unified terminology.

* Minor bug fix.

* State is an incredibly vaguely named variable. Changed convention to represent what it actually is.

* Also changed function name.

* Fixed bug.
2021-05-20 21:58:27 +02:00
liquidev 78999cabe2
Improved Lua syntax (#201)
* improved Lua syntax

* added some missing cases with number literals
2021-05-20 19:02:40 +02:00
Janis-Leuenberger b15914d664
Add default keymap documentation (#199) 2021-05-20 13:43:56 +02:00
Francesco Abbate a02691f18e Merge topic branch for tabs scrolling buttons 2021-05-19 22:59:29 +02:00