Commit Graph

426 Commits

Author SHA1 Message Date
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
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
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
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
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 Abbate 739763675e Check the real absolute path of user module
Close issue #212
2021-05-22 23:32:45 +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
Francesco Abbate abc69a7a19 Prepare release 1.16.10 2021-05-22 14:55:58 +02: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
Francesco Abbate a02691f18e Merge topic branch for tabs scrolling buttons 2021-05-19 22:59:29 +02:00
Adam b278306fc9
Changed deindent, so that if the deindent runs into an unusual line with a partial indent at the front, it'll still de-indent that. (#193) 2021-05-19 22:41:28 +02:00
liquidev 86a7037ed9
support for multiple groups in one pattern (#196) 2021-05-19 22:35:28 +02:00
Francesco Abbate a92d15fe30 Use all the available space for tabs
Use a tab's width larger than style.tab_width if there is enough
available space to display the number of tabs specified in
config.max_tabs.
2021-05-19 10:09:40 +02:00
lqdev ba4fbde33d fixed mixed indentation 2021-05-18 17:52:18 +02:00
Francesco Abbate 1fb01f36df Avoid overflowing tab rectangles when animating 2021-05-17 15:11:06 +02:00
Francesco Abbate 13529c28d4 Cosmetic variable name change 2021-05-17 13:37:05 +02:00
Francesco Abbate ba40bc0dfc Final adjustments to tab's rect computations 2021-05-17 12:14:01 +02:00
Francesco Abbate 92322986b8 Fix error with previous commit
Error was introduced with PR:

https://github.com/franko/lite-xl/pull/190
2021-05-17 10:16:55 +02:00
Adam 6e08c3321c
Fixed a bug where if detectindent is paired with another plugin that hooks the event, it'll overwrite the other plugin's functions. (#190) 2021-05-17 10:05:08 +02:00
Adam e43f1b9df9
Unified open and saving style. (#189) 2021-05-17 09:29:51 +02:00
Adam 85d0d684de
Truncated lines longer than 256 characters, and skipped to the relevant portion of the line to reduce slowdown and increase relevancy. (#185) 2021-05-17 09:16:20 +02:00
Adam e54ffc49ea
Added in keyboard shortcuts to the project search module. (#188) 2021-05-17 09:14:46 +02:00
Cukmekerb bd4efa14a2
add `of` keyword to language_js.lua and improve js string syntax highlighting in (#186) 2021-05-17 08:56:21 +02:00
Adam c7b1a6f53e
Allowed for optional boolean to better match filenames. (#180) 2021-05-16 19:23:17 +02:00
Francesco Abbate b37c190db2 Add buttons to scroll tabs when there are too many
Use config.max_tabs to configure the maximum number of tabs that can
be shown. Beyond the maximum value scroll buttons will appear to scroll
the tabs.
2021-05-16 15:50:27 +02:00
Francesco Abbate 90e41daa99 Add tab animation and improve hovering update
Always update the tab hovering status using the Node:update
method. Previous behavior was to update only on mouse moved
events.
2021-05-15 16:57:20 +02:00
Francesco Abbate b223dbca6f Use unicode ellipsis to truncate tab's text
For proportional fonts is equivalent to three dots but it makes a
lot of difference for monospaced fonts.
2021-05-15 16:27:29 +02:00