Commit Graph

901 Commits

Author SHA1 Message Date
Adam e4fd3afa88
Merge pull request #283 from vincens2005/master
Allow for hiding of the X button on the tabs
2021-06-18 09:42:30 -04:00
Francesco Abbate cfd3bebfcc Provide specific syntax plugin for C++
We have only the problem to attribute the .h either to C or C++ but
we don't have currently any way to discriminate them.
2021-06-18 12:00:24 +02:00
cukmekerb e493fa1b0a clicking the empty space where the x was no longer closes the tab 2021-06-17 21:15:30 -07:00
cukmekerb e1d85af69b added config.tab_close_button option to hide X on tabs 2021-06-17 18:35:36 -07:00
Cukmekerb eed5b79030
Merge branch 'lite-xl:master' into master 2021-06-17 18:17:01 -07:00
jgmdev e9e1214e59 [plugin/scale] fixed wrong increase and decrease
If the user manually set the desired scale by calling scale.set(1.60)
the scale_level was not set accordingly which meant that later doing
a Scale:Increase/Decrease command yielded incorrect scale amount.
2021-06-17 20:58:22 -04:00
Adam d45ec645d3 Added in the ability to customize the config directory used with the environment variable XDG_CONFIG_HOME. (#271) 2021-06-17 23:39:26 +02:00
Francesco Abbate 66275fe207 Fix error in dirname computation in TreeView
In TreeView:on_mouse_pressed() we need to find the directory a
relative filename belongs to from its absolute filename.
The code was using string.find to locate the relative filename
within the absolute path but in some very specific cases we can
find a pattern which is not the right-most one leading to a
wrong directory name.

Fix the error by adding a loop to make sure we find the right-most
match. The standard Lua library has not a string.rfind to make a
reverse search.

Add a check to avoid trying to updating a topdir project directory.
2021-06-17 23:39:26 +02:00
Adam Harrison 4fc910dbdb Replaced fill loop with SDL_FillRect. 2021-06-17 23:31:44 +02:00
Francesco Abbate 2af92e9af1 Fix whitespace errors 2021-06-17 23:31:44 +02:00
Francesco Abbate 704a8dea09 Group mouse move events from C API function
Groups together consecutive mouse move events like done in core.step()
lua function but on the C side.

It does not introduce any meaningful speedup but it theory is more efficient and
simplifies the Lua code.

The simplification of the Lua code alone is enough to justify this change?
2021-06-17 23:31:44 +02:00
Björn Buckwalter 212e5e326c MacOS modifier key adjustment (replace `alt`) per #262 (#263)
* Use `cmd` as modifier key for tab seletion (macos)

Part of #262.

* Use `cmd+shift` instead of `alt` on macos

Fixes #262.
2021-06-17 23:31:44 +02:00
Björn Buckwalter 3fe8b135af Use `ctrl` for next tab on macos
Fixes #261.
2021-06-17 23:31:44 +02:00
Francesco Abbate 1ea28eb38b Fix error in workspace file error reporting 2021-06-17 23:31:44 +02:00
Francesco Abbate ab9960cddf Do not save log views in session file 2021-06-17 23:31:44 +02:00
Francesco Abbate f682215b41 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-17 23:31:44 +02:00
Ferdinand Prantl 2365dfa9c0 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-17 23:31:44 +02:00
Ferdinand Prantl d941535600 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-17 23:31:44 +02:00
Francesco Abbate 73bda963a5 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-06-17 23:31:28 +02:00
Adam 5151e36981
Added in the ability to customize the config directory used with the environment variable XDG_CONFIG_HOME. (#271) 2021-06-17 23:15:08 +02:00
Adam bdc37f1f6c
Added in remove file function. (#272)
* Added in remove file function.

* Changed namespace of rename and remove (now delete).
2021-06-17 22:26:27 +02:00
Francesco Abbate 1ad4289e76 Do not try to update topdir folder in treeview
If the directory expanded is a project's top directory
do not attempt to update its content.

Fix again issue #275
2021-06-17 19:07:32 +02:00
Francesco Abbate 4c9083398a Fix error in dirname computation in TreeView
In TreeView:on_mouse_pressed() we need to find the directory a
relative filename belongs to from its absolute filename.
The code was using string.find to locate the relative filename
within the absolute path but in some very specific cases we can
find a pattern which is not the right-most one leading to a
wrong directory name.

Fix the error by adding a loop to make sure we find the right-most
match. The standard Lua library has not a string.rfind to make a
reverse search.

Close #275
2021-06-17 18:23:30 +02:00
Francesco Abbate b39db791f9 Do not duplicate RootView method in contextmenu
The method RootView:on_mouse_pressed was copied in the contextmenu plugin with
a small modification to intercept the mouse clicks of the active view.

This approach is problematic because a relatively large portion of code is
duplicated.

We introduced a function named RootView.on_view_mouse_pressed to let plugins
like contextmenu intercepts mouse clicks in the active area without duplicating
the function RootView:on_mouse_pressed.
2021-06-17 10:22:31 +02:00
Adam Harrison 2fc245eb69 Added in an interface to the scale plugin. 2021-06-14 20:33:15 -04:00
Adam Harrison aed643893e Fixed contextmenu to play nice with dragging nodes. 2021-06-14 09:23:04 -04:00
jgmdev e070dbebc1 Fix undeclared NagView findindex() by moving it to common. 2021-06-13 21:28:29 -04:00
Francesco 98164f6d4f
Integrate mkdirp function in common module (#265)
Move the function mkdirp into common to be generally available.

Use the new common.mkdirp from create_user_directory() from
core/init.lua replacing previous parent directory creation code
within the function.

The previous mkdirp function did not work on Windows where
absolute paths starts with a drive letter. The code from
create_user_directory() did not have this problem but was wrong
in the way it was creating the nested directories.

The new implementation in common.mkdirp fix both problems.
2021-06-13 19:50:42 +02:00
Jefferson González 9823da8531
Merge pull request #267 from jgmdev/nagview-fix
Added missing NagView dialog commands to startup.
2021-06-12 23:14:17 -04:00
Adam 804429e3b6
Merge pull request #266 from adamharrison/QuickOptimization
Replaced fill loop with SDL_FillRect.
2021-06-12 22:53:14 -04:00
Adam 637b7f952d
Merge pull request #256 from adamharrison/FixTabDragging
Allows you to drag nodes around splits.
2021-06-12 17:59:08 -04:00
Adam 6097ba36d7
Merge pull request #269 from Jan200101/docdir-patch
documents should not be put into global doc root
2021-06-12 14:31:26 -04:00
Adam Harrison 66b76f15c2 Added a check for duplicate tabs, also ensured that the appropriate view is set as active. 2021-06-12 14:24:31 -04:00
Adam Harrison a18eeafbc8 Added in some more checks. 2021-06-12 13:43:58 -04:00
Adam Harrison f729d7d008 Allows you to drag nodes around splits. 2021-06-12 13:43:58 -04:00
Jan200101 7ea096247c
documents should not be put into global doc root 2021-06-11 23:38:25 +02:00
Francesco Abbate 0f2ac136d0 Fix whitespace errors 2021-06-11 15:02:15 +02:00
Francesco Abbate 752ecd5ece Group mouse move events from C API function
Groups together consecutive mouse move events like done in core.step()
lua function but on the C side.

It does not introduce any meaningful speedup but it theory is more efficient and
simplifies the Lua code.

The simplification of the Lua code alone is enough to justify this change?
2021-06-11 15:00:18 +02:00
jgmdev 9153f5695d Added missing NagView dialog commands to startup. 2021-06-09 20:13:23 -04:00
Adam Harrison 214e6898df Reverted if guard. 2021-06-09 19:34:02 -04:00
Adam Harrison aa9f16c74c Added in #if guard for ARM achitectures. 2021-06-09 18:05:39 -04:00
Björn Buckwalter 702ab2625c
MacOS modifier key adjustment (replace `alt`) per #262 (#263)
* Use `cmd` as modifier key for tab seletion (macos)

Part of #262.

* Use `cmd+shift` instead of `alt` on macos

Fixes #262.
2021-06-09 20:23:40 +02:00
Adam Harrison 29837d0c41 Replaced fill loop with SDL_FillRect. 2021-06-08 21:31:09 -04:00
Adam 7de1fde9cf
Merge pull request #264 from bjornbm/issue261
Use `ctrl` for next tab on macos
2021-06-08 15:16:00 -04:00
Björn Buckwalter ef48d5d48c Use `ctrl` for next tab on macos
Fixes #261.
2021-06-08 16:13:00 +02:00
Francesco Abbate e7d0709828 Fix error in workspace file error reporting 2021-06-08 12:06:54 +02:00
Jefferson González b4896ed69e
[plugin/contextmenu] Append itemsets that where registered. (#258) 2021-06-07 23:29:03 +02:00
Takase 0fd1fa8872
Commands refactor (#257)
* remove unecessary check

* move command registration to core/commands
2021-06-07 23:00:29 +02:00
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