Guldoman
c512d01a68
Fix horizontal scroll with shift+scroll on MacOS
...
It seems like pressing shift+scroll on MacOS automatically makes it
shift+horizontal scroll.
2022-11-01 21:20:37 +01:00
Guldoman
8a9bac7de3
Fix drawwhitespace drawing lines with different substitution kinds
...
When multiple substitution kinds are present in the same line, they're
placed in the cache in an order that's spatially consistent only between
items of the same kind.
Because we stopped drawing after we reached the first invisible
substitution, the subsequent kinds weren't drawn even if they should
have been.
2022-10-30 02:54:30 +01:00
Guldoman
715411061b
Apply doc commands to anything that extends DocView
...
This fixes a regression caused by
cf29a6a45f .
2022-10-24 04:47:26 +02:00
Guldoman
decbac4ac6
Check if scrollbar is no longer hovered on mouse release
2022-10-16 04:43:15 +02:00
Guldoman
6ca56fee1a
Only consider left clicks on the scrollbar
2022-10-16 04:40:03 +02:00
Guldoman and GitHub
6b754eb628
Refactor scrollbar into its own file ( #1124 )
...
* Move scrollbar to its own file
* Don't call `Scrollbar` functions if `View` is not scrollable
* Allow horizontal scrolling in `Scrollbar`
* Add horizontal scrollbar to `View`
* Add `root:horizontal-scroll` command with `shift+wheel` keymap
* Prioritize vertical scrollbar hover
* Don't send mouse movement to vertical scrollbar when dragging horizontal one
* Fix clicking on horizontal scrollbar track
* Implement `start` scrollbar alignment
* Add documentation to `Scrollbar`
* Make `DocView` infinitely scrollable horizontally
* Handle horizontal scroll SDL event
2022-10-15 20:12:15 -04:00
Guldoman and GitHub
5c2c95765e
Add IME support ( #991 )
2022-10-15 19:58:51 -04:00
Guldoman and GitHub
334a7da5c9
Use the syntax with the longest match ( #919 )
...
This way, for example, a syntax that applies to `docker-compose.yml`
files will take precedence over one that applies to `*.yml` files.
2022-10-12 18:10:11 -04:00
Guldoman and GitHub
e7a575b4c4
Use relative mouse position directly for drop event ( #1140 )
...
Previously the relative position was calculated using the window
position and the global mouse coordinates. In some systems like wayland,
this operation returns incorrect values.
2022-10-09 20:13:51 -04:00
Guldoman and GitHub
a19cfb4f80
Strictly limit find/replace commands to core.docview ( #1108 )
...
Without this, find/replace commands applied to the `CommandView` too,
with buggy results.
2022-09-13 22:29:52 -04:00
Guldoman
c25f83da90
Make predicate for some TreeView commands stricter
...
This avoids performing the `treeview:new-folder` command on ctrl +
double click.
This happens because `ctrl+lclick` (which is the keybinding for
`treeview:new-folder`) is triggered also by ctrl + double click, which
isn't captured by anything else.
2022-08-21 20:03:32 +02:00
Guldoman
cbe0fd63bf
Reduce double click radius
...
SDL uses 32 pixels by default, which is a bit too much and causes
problems with, for example, adding multiple close selections too
quickly.
2022-08-21 19:08:32 +02:00
Guldoman
4c186b07a3
Be more lenient with appending PATHSEP in common.path_suggest in Windows
...
This allows to use the Unix separator without resulting in ugly
suggestions that added the Windows separator too.
For example:
Before: `data/` -> `data/\core\`
After: `data/` -> `data/core\`
2022-08-17 00:11:19 +02:00
Guldoman
e8ca861512
Remove final PATHSEP in common.normalize_volume
2022-08-16 23:53:03 +02:00
Guldoman
a4355c6536
Add PATHSEP before listing the directory in common.path_suggest
...
Before, in Windows, listing `.` instead of `.\` resulted in unexpected
results.
2022-08-16 23:51:12 +02:00
Guldoman
6aa96556c0
Replace assert with core.log_quiet on command replace
...
This caused issues when saving the user module with commands defined
inside it, as it resulted in the user-defined commands trying to
overwrite themselves and failing.
2022-08-16 22:18:50 +02:00
Guldoman
d944bd85ec
Add predicate memoization to command.get_all_valid
2022-08-16 22:13:25 +02:00
Guldoman
06b9953777
Use Object:is instead of direct metatable comparison in autocomplete
2022-08-16 22:13:25 +02:00
Guldoman
cf29a6a45f
Allow command predicates to manage parameters passed to the commands
...
When a command is performed with parameters, those are now passed to the
predicate.
The predicate can then return, after the validity boolean, any other
value that will then be passed to the actual command.
If the predicate only returns the validity boolean, the original
parameters are passed through to the actual command.
This allows predicates to manipulate the received parameters, and allows
them to pass the result of an expensive computation to the actual
command, which won't have to recalculate it.
String and table predicates will now also return `core.active_view`.
2022-08-16 22:13:16 +02:00
Guldoman
4b4c54ba65
Remove dot slash from suggested paths in common.path_suggest
...
When no `root` is specified and the initial `path` is empty, the initial
`path` becomes `.`.
This results in returned files/dirs that are prepended with `./`.
Now, in that case, `./` is removed.
2022-08-16 08:08:04 +02:00
Guldoman
63c818ac45
Enable SDL timers
2022-08-03 17:28:43 +02:00
Guldoman and GitHub
4db71836af
Clear default Lua require path ( #1085 )
...
This is mainly done to avoid requiring from the current working
directory of the editor.
This also avoids requiring from system paths, as it was already the case
for the native modules search path.
2022-08-03 11:13:26 -04:00
Guldoman and GitHub
06b2fada07
Merge pull request #1079 from cisoun/master
...
Add font style options in user module
2022-07-16 04:27:39 +02:00
Guldoman
d7f9b30d05
drawwhitespace: Invalidate cache on indent size change
2022-07-15 06:54:03 +02:00
Guldoman and GitHub
2dac3667cb
Merge pull request #1073 from ncarrezdev/ncarrezdev/synxtax-corrections
...
[chore]: Update syntax
2022-07-13 15:05:26 +02:00
Guldoman
9cfa3ecd56
Make StatusView:add_item accept a table
2022-07-13 07:22:42 +02:00
Guldoman
693bd11b22
Don't wrap around if there are no suggestions in CommandView
2022-07-11 23:28:08 +02:00
Guldoman and GitHub
86024586fd
Start dirmonitor check thread only after a watch is added ( #1072 )
2022-07-11 17:14:50 -04:00
Guldoman
e7c4bdfe8e
Make Doc:get_selection[s] return if the selection was actually sorted
2022-07-11 05:39:55 +02:00
Guldoman and GitHub
f5fbdd80f6
Merge pull request #1066 from benwalksaway/match_case_syntax_support
...
language_python: add syntax support for the match-case statement
2022-07-03 15:28:54 +02:00
Guldoman
7888bf08e9
LogView: Show scrollbar
2022-07-01 05:29:55 +02:00
Guldoman
b84a510d42
Increase default maximum number of log items
...
The low number in some cases resulted in hidden errors.
2022-07-01 05:29:54 +02:00
Guldoman
caf106be1d
LogView: Don't draw invisible items
2022-07-01 05:29:45 +02:00
Guldoman
79dd8779c4
autocomplete: Fix "Too many symbols" message when Doc has no name
...
Before, when a `Doc` had no name, an error was thrown.
2022-06-29 05:54:37 +02:00
Guldoman
92c2815aa4
language_md: Limit inline math mode to the current line
2022-06-28 20:09:36 +02:00
Guldoman
259de54c33
Fix opening LogView when reloading customizations
...
As `reload_customizations` was called during save operations, opening
the `LogView` changed `core.active_view` which caused some errors to be
thrown.
2022-06-28 04:21:43 +02:00
Guldoman
c792b13666
On doc:newline remove line content if it contains only whitespace
2022-06-25 03:57:47 +02:00
Guldoman
d6ce9e1ac6
Don't indent empty lines in a selection
2022-06-25 03:32:47 +02:00
Guldoman
438ed6984a
drawwhitespace: Invalidate cache on font size change
2022-06-25 03:30:33 +02:00
Guldoman
9cd47aa12e
Fix full line cut when only a single line remains
2022-06-24 05:49:20 +02:00
Guldoman
ec0e3018a8
findreplace: Sort last searches
2022-06-23 05:16:47 +02:00
Guldoman
522d8a8094
findreplace: Fix number of total replacements
2022-06-23 00:16:16 +02:00
Guldoman
76c1db97f5
drawwhitespace: Use Docview vertical line offset
2022-06-20 19:56:53 +02:00
Guldoman and GitHub
205e554d87
Merge pull request #1047 from jgmdev/PR/cv-draw-visible
...
CommandView: improve performance by only drawing visible
2022-06-20 17:35:06 +02:00
Guldoman
2d3abd2533
drawwhitespace: Invalidate cache on config changes
2022-06-16 00:03:25 +02:00
Guldoman
d169619f69
Warn if token type is a table when not needed
2022-06-15 21:31:16 +02:00
Guldoman
2e37e85a48
Add helper function to report bad patterns in tokenizer
2022-06-15 21:28:46 +02:00
Guldoman
5027a0f12b
Fix malformed pattern check for group patterns in tokenizer
...
If the token type was a simple string (and not a table), the size of the
string was used instead of `1`.
2022-06-15 19:33:58 +02:00
Guldoman
5b6b48320f
Check if "open" pattern is escaped
...
Previously this check was only done for "close" patterns.
2022-06-12 04:19:05 +02:00
Guldoman
c947e8a4d1
Convert more byte offsets to utf-8 pos in regex tokenizer
2022-06-12 02:55:36 +02:00
Guldoman
f38723ea46
drawwhitespace: Cache whitespace location
2022-06-11 06:30:13 +02:00
Guldoman
685956cbdb
Add Highlighter:update_notify to keep track of retokenized lines
...
This is helpful for plugins that need to know when a line has been
retokenized.
2022-06-11 06:21:55 +02:00
Guldoman
99d328cfd7
Downgrade StatusView:get_items deprecation message to warning
2022-06-11 05:13:37 +02:00
Guldoman
ed02a55cc1
language_md: Add math delimiters
2022-06-10 23:55:41 +02:00
Guldoman
237f0c91cb
Open LogView on user/project module reload error
2022-06-05 04:29:24 +02:00
Guldoman
0b96be7af2
Make common.merge work with invalid arguments
...
This is needed because users could try to enable plugins with
`config.plugins.plugin_name = true`.
Before, this would result in `common.merge` throwing an error; now it
just returns a copy of the "base" table.
2022-06-05 04:10:51 +02:00
Guldoman
ec58b1f0bd
Add text and select_text to CommandView options
2022-06-02 19:30:51 +02:00
Guldoman
6c89a3e575
Add show_suggestions to CommandView options
2022-06-02 19:30:22 +02:00
Guldoman
8ce1ecb897
Fix CommandView:enter deprecation log
2022-06-02 06:42:58 +02:00
Guldoman
d390eb248e
Fix tooltip not getting removed after find-replace:replace
2022-06-01 18:19:33 +02:00
Guldoman
730ea0c91b
Make TreeView more multi-project-dir aware
2022-06-01 06:58:04 +02:00
Guldoman
e94c996a26
Add TreeView helper functions to get previous/next item
2022-06-01 06:58:04 +02:00
Guldoman
295e6b7e5a
Allow common.path_suggest to specify a root directory
...
This will make relative paths start from `root`.
2022-06-01 06:57:38 +02:00
Guldoman
9a428648a9
Add common.is_absolute_path
2022-06-01 04:42:50 +02:00
Guldoman
fae9af96bf
Expose function to create custom log entries
2022-05-31 02:35:56 +02:00
Guldoman
db2d30caaf
Add warn log level
2022-05-31 02:26:42 +02:00
Guldoman
c92f6a7b7f
Always show backtrace for error log entries
2022-05-31 02:26:18 +02:00
Guldoman
d8efb1ab53
Show error if language plugin pattern has mismatching number of groups
...
The number of results from a pattern with groups must never be greater
than the number of token types for that pattern.
Also if a token type was undefined, it's now pushed as a `normal` one.
2022-05-31 02:05:37 +02:00
Guldoman
7ac776bef6
Fix UTF-8 matches in regex group tokenizer
2022-05-31 01:59:14 +02:00
Guldoman
4f0d45d6ab
Don't check unnamed files in autoreload plugin
2022-05-31 01:03:59 +02:00
Guldoman
11e27c6fda
Use new CommandView:enter options table
2022-05-30 22:08:13 +02:00
Guldoman
e4a806a9d0
Add options to CommandView:enter
...
Now `CommandView:enter` can accept a table that specifies its behavior.
The old behavior is kept for compatibility.
2022-05-30 22:07:39 +02:00
Guldoman
2a41002355
Allow using regex groups to split tokens
...
Before, this was only supported by Lua patterns.
This expects the regex to use the same syntax used for patterns. That
is, the token should be split by empty groups.
2022-05-28 01:38:22 +02:00
Guldoman
14be51b1ec
Make regex.match return all the results
2022-05-28 01:21:41 +02:00
Guldoman
74f7389cac
Make regex API return integers
2022-05-28 01:20:41 +02:00
Guldoman and Adam Harrison
8156836126
Fix ren_font_group_get_tab_size returning unexpected values
...
We were casting the `xadvance` to an int, so in some cases the resulting
tab size was wrong.
2022-05-04 10:26:48 -04:00
Guldoman
0ca0e36009
Open LogView in correct Node
...
Using `get_active_node` might result in a locked `Node`; calling
`add_view` on that `Node` throws an error.
`get_active_node_default` always returns an unlocked `Node`.
2022-05-04 02:58:34 +02:00
Guldoman
f8622efc01
Add pretty printing to common.serialize
2022-05-03 06:28:34 +02:00
Guldoman and GitHub
d3c38d699c
Merge pull request #966 from adamharrison/check-plugin-load-time
...
Added plugin load-time log.
2022-05-02 01:59:12 +02:00
Guldoman and GitHub
2e0d0995d6
Add typeahead to CommandView ( #963 )
2022-04-30 16:09:40 -04:00
Guldoman and GitHub
9de75988ba
Send mouseleft event when the mouse leaves the window ( #928 )
...
* Send `mouseleft` event when the mouse leaves the window
* Call `View:on_mouse_left` when the mouse leaves the `View`
Previously `View:on_mouse_left` was called only when the mouse left the
window, and it was called on every visible `View`.
Now it gets also called when the mouse "changes" `View`, and only the
last `View` the mouse was on will receive the event.
2022-04-28 21:50:34 -04:00
Guldoman
ac42e6457a
Check if USERDIR doesn't exist in core.delete_temp_files
2022-04-28 01:55:07 +02:00
Guldoman
f92f56d42e
Manage return values from "replacer" function in Doc:replace
...
Before the addition of multi-cursor support, we just returned the second
return value of the "replacer" function to the caller.
With the introduction of multi-cursors, we naively summed the second
return values for each cursor.
In some cases the "replacer" function doesn't return any second value,
so we tried to do math with `nil`, thus throwing errors.
Now the second return value is added to a table which is then returned
to the caller.
2022-04-27 21:53:35 +02:00
Guldoman
3950406750
Catch mouse clicks if contextmenu is open
...
Also disallow re-opening the `contextmenu` if it's already visible.
2022-04-27 17:55:46 +02:00
Guldoman
a7ea84ae8f
Clamp scroll position when dragging the scrollbar without animations
2022-04-26 22:50:44 +02:00
Guldoman and GitHub
444b3e3c66
Don't animate scrolling by dragging the scroll bar ( #940 )
...
Also added the `config.animate_drag_scroll` option to re-enable the
behavior.
2022-04-26 09:54:11 -04:00
Guldoman and GitHub
0c456eb664
Allow functions in keymap ( #948 )
...
This allows `keymap.add` to map shortcuts to functions.
If the function returns `false`, the next command is executed (as if the
`predicate` of a `command` failed).
2022-04-26 09:48:59 -04:00
Guldoman
7dd83bb737
Fix ren_font_group_get_tab_size returning unexpected values
...
We were casting the `xadvance` to an int, so in some cases the resulting
tab size was wrong.
2022-04-26 04:34:18 +02:00
Guldoman and GitHub
f42dbb0060
Add animation categories to enable finer transitions control ( #941 )
...
* Allow finer control over transitions
* Add categories to transitions
2022-04-25 20:35:35 -04:00
Guldoman
b9957138ac
Add launchable tag to AppStream xml
2022-04-21 00:41:15 +02:00
Guldoman and GitHub
1439b59d65
Improve performance of ren_draw_rect ( #935 )
...
We color a 1x1 `SDL_Surface` with the desired color. This surface is
then stretched over the area we need to cover using `SDL_BlitScaled`.
This way we avoid having to do the blending ourselves.
2022-04-20 17:13:42 -04:00
Guldoman and GitHub
bbac7e479c
Set the correct working directory for the AppImage version ( #937 )
2022-04-20 17:00:48 -04:00
Guldoman
9a5f8e72d0
Add DATADIR and USERDIR explanation in created user module
2022-04-18 21:14:50 +02:00
Guldoman
93b31211cb
Apply drawwhitespace plugin only to DocViews
2022-04-12 04:05:59 +02:00
Guldoman
43086a9c24
Fix missing pixel in scrollbar
2022-04-12 03:20:27 +02:00
Guldoman
4f434d1a41
Show arrow cursor when hovering DocView scrollbar track
2022-04-12 02:56:41 +02:00
Guldoman
48c371a638
Add scrollbar "track" and resize on hover
2022-04-12 02:56:30 +02:00
Guldoman
052c140787
Fix DocView:on_mouse_released not considering all parameters
2022-04-12 02:38:30 +02:00
Guldoman
202e42b568
Avoid calling View:scrollbar_overlaps_point uselessly
...
`View:on_mouse_moved` already updated `self.hovered_scrollbar`, so use
that instead.
2022-04-12 02:37:21 +02:00
Guldoman
e5c55e8abc
Early break if autocomplete needs to update
2022-04-10 04:20:46 +02:00