Commit Graph

1292 Commits

Author SHA1 Message Date
Guldoman 138cea45d5
Make `dirwatch` sorting compatible with what `file_bisect` expects (#1300)
The result of `a.filename < b.filename` is sometimes different from 
`system.path_compare(a.filename, a.type, b.filename, b.type)` which 
causes issues to `file_bisect`, as it expects the sorting to be done 
with `system.path_compare`.
2023-08-19 12:28:19 +08:00
Dave 0fa0a59c8b
Minor typos in init text 2023-08-19 12:28:18 +08:00
Guldoman 74349f8e56
Fix horizontal scroll with touchpad on MacOS 2022-12-28 17:26:57 +01:00
Jefferson González 870d685b59
contextmenu: adjust y positioning if less than zero (#1268)
* use clamp for both x and y coords
2022-12-28 02:51:24 -04:00
xwii 271a804986
Fix popping subsyntaxes that end consecutively (#1246) 2022-12-27 20:24:52 -04:00
Simon Krauter 8603644726
Fix two typos in data/init.lua (#1272) 2022-12-27 19:56:30 -04:00
Martin Ashby d4989d98bd
Add example settings to _overwrite_ an existing key binding (#1270) 2022-12-27 18:40:22 -05:00
Guldoman 18e3542be0
Allow `TreeView` file operation commands when focused (#1256)
Impacts `treeview:{rename,new-file,new-folder,open-in-system}`.
Previously those were only available when the mouse was over the 
`TreeView`.
They now use the same predicate as `treeview:delete`.
2022-12-26 13:41:14 -04:00
Guldoman 97bfe503a0
`detectindent`: Limit subsyntax depth (#1253) 2022-12-20 22:28:29 -04:00
sammyette 1810db0705
fix: move tab scroll buttons to remove spacing before 1st tab (#1231)
* fix: move tab scroll buttons to remove spacing before 1st tab
* fix: always show tab scroll buttons
* fix: cleanup code, get scroll button rect for correct button
* fix: expand to full size for tabs if scroll buttons arent visible
* fix: define n as visible tabs number
2022-12-20 22:06:53 -04:00
Guldoman c42f01ed1f
Improve IME location updates (#1170)
* Avoid updating IME input rect if it hasn't changed
* Update the IME input rect even when the composition didn't change
* Apply IME input blocking workaround to non-Linux only
2022-12-20 20:11:13 -04:00
Jefferson González 902539b97a
trimwhitespace: expose functionality and extra features (#1238) 2022-12-20 18:13:56 -04:00
Guldoman 213dc7142e
`toolbarview`: Remove tooltip when hidden (#1251) 2022-12-20 18:07:29 -04:00
Jefferson González 3c64c32379
core: ported regex.gsub to faster native version (#1233)
* added regex.gmatch iterator and other fixes
* fixed issues reported by Guldoman
* push strings with fixed len just in case for binary safety
* added limit to regex.gsub and use pushinteger
* added description to regex.gsub limits param
* replaced substitutions regex description for correctness
* ignore negative limits on regex.gsub
2022-12-20 17:46:37 -04:00
Cyriaque Skrapits 5b5b5fd3e3
contextmenu: make divider less aggressive (#1228)
Following changes are applied:
- use divider color instead of caret;
- add a vertical padding on the divider.
2022-12-20 17:29:53 -04:00
Jefferson González e152db2cce
plugins projectsearch: expose its functionality (#1235) 2022-12-14 11:53:20 -04:00
Guldoman 9d48441685
Add `regex.find_offsets`, `regex.find`, improve `regex.match` (#1232)
`regex.match` now behaves like `string.match`.
This required changes in the `tokenizer` and in the `detectindent` 
plugin.
2022-12-11 22:25:42 -04:00
sammyette e13f265fac
feat: alert user via nagview if file cannot be saved (#1230)
* feat: alert user via nagview if file cannot be saved
it will prompt the user to choose whether they
want to save to another location and perform
the save as command
* refactor: change defer draw call to thread
* feat: log error when attempting to save doc
2022-12-11 21:38:58 -04:00
Techie Guy 68595e4c7c
autocomplete: wrap the autocomplete results around (#1223) 2022-12-06 06:21:14 -04:00
sammy dfa2f93d9c
feat: encode home in statusview file path (#1224) 2022-12-06 06:19:52 -04:00
Guldoman f7ad8753eb
Improve `regex.gsub` performance (#1220) 2022-12-02 19:21:05 -05:00
jgmdev 0373d29f99 statusview: respect right padding of item tooltip
When the tooltip was rendered on the last item of right items the right
padding was not properly getting accounted as part of the tooltip width.

This commit also fixes:

* Passing StatusView to item.get_item() instead of StatusView.item
* Some adjustments to annotations.
2022-11-24 12:34:49 -04:00
Guldoman 51f2a291d3
Make `Scrollbar` follow `force_status` when animations are disabled 2022-11-15 21:08:33 +01:00
Guldoman 519b91c2dd
Pass the currently selected item to `CommandView` validation (#1203) 2022-11-15 12:03:13 -04:00
Guldoman c6c485feb0
Use subsyntax info in `doc:toggle-{line,block}-comments` 2022-11-15 16:11:37 +01:00
Guldoman 0a1b8b6bb1
Set initial tokenizer state to a `NULL` byte 2022-11-15 16:01:04 +01:00
Guldoman e147a6cb9b
Add `tokenizer.extract_subsyntaxes` 2022-11-15 16:00:48 +01:00
jgmdev acebbfd88a linewrapping: fix enabled always by mistake introduced with #1190 2022-11-07 13:59:13 -04:00
jgmdev fb43e6f9e6 traceback: some lua versions do not support message as nil 2022-11-07 12:48:09 -04:00
Quinten Kock 4a5851afe5
Make linewrapping plugin recompute breaks before scrolling (#1190) 2022-11-06 22:34:07 -04:00
Jefferson González 9c7304f555
highlighter: autostop co-routine when not needed (#881)
* highlighter: autostop co-routine when not needed

* applied @Guldoman suggestions
2022-11-06 03:38:10 +01:00
Jefferson González b8a4f729df
tokenizer: remove the limit of 3 subsyntaxes depth (#1186)
* tokenizer: remove the limit of 3 subsyntaxes depth

Make the state a string of bytes instead of a 32bits integer to be able
to have deeper subsyntax support. Fixes issues with syntax files like
the one for PHP that was already hitting more than 3 subsyntaxes depth.

* remove unnecesary call to set_subsyntax_pattern_idx

* fixed wrong word on comments
2022-11-03 18:56:20 -04:00
Guldoman 03cc5ffcd1
Add `config.keep_newline_whitespace` option (#1184)
This option will avoid removing line content when pressing enter in 
lines with only whitespace.
2022-11-03 12:40:27 -04:00
Guldoman b029f5993e
Don't sort in `Doc:get_selection_idx` with an invalid index 2022-11-02 21:11:41 +01:00
Jefferson González 69bccf6fcf
docview: support gutter click selection, fixes #1116 (#1169)
* docview: support gutter click selection, fixes #1116

* Added missing call to parent on_mouse_pressed

Also fixed call to selections when `shift` is pressed.

* change to arrow instead of hand

Co-authored-by: Adam <adamdharrison@gmail.com>
2022-11-01 19:34:23 -04:00
Guldoman ed226c476e
Add more options to `Scrollbar` (#1174)
* Make `Scrollbar` accept a table for its options

* Add `force_status`, `{expanded,shrinked}_size` options to `Scrollbar`

* Add `Scrollbar:set_forced_status`

* Add `config.force_scrollbar_status` to force `DocView` scrollbars status
2022-11-01 18:38:50 -04:00
Guldoman 0f160e614e
Improvements to multicursor copy/paste (#1123)
* Add `Doc:get_selection_idx`

* Make multicursor paste add a cursor at the end of each paste

* Better manage paste of multicursor whole line copy

* Document `Doc:get_selection_idx`

* Keep track of last added selection in `Doc`

* Make use of `doc.last_selection` in `Doc` commands

* Make `Doc:get_selection` return the `Doc.last_selection` if possible
2022-11-01 18:16:39 -04:00
Guldoman b52fe1605e
Make MacOS `core:restart` shortcut more in line with other platforms 2022-11-01 21:21:50 +01:00
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
jgmdev 0030c69524 plugin autocomplete: update partial on manual trigger 2022-10-25 17:20:31 -04: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
Jefferson González af6c4bc152
core syntax: strip the path from filename on syntax.get (#1168) 2022-10-22 20:04:54 -04:00
Jefferson González f02b3c46e6
Merge pull request #1167 from jgmdev/PR/new-lines
* plugin drawwhitespace: allow newline substitution
* docview: do not render newline fixes #1164
2022-10-22 19:56:43 -04:00
jgmdev 3da6833249 docview: do not render newline fixes #1164 2022-10-21 13:56:23 -04:00
jgmdev 261292c6aa plugin drawwhitespace: allow newline substitution 2022-10-21 13:53:42 -04:00
Adam dd6eee1542
Fixed the common idiom of setting a plugin to true. (#1152) 2022-10-20 18:04:28 -04:00
Takase 437b954595
make the default core.ignore_files more specific (#1160)
* make the default core.ignore_files more specific

instead of blanket ignoring all dotfiles, we define a list of folders
and files to ignore. this makes the overall experience better.

* fix wrong path pattern

* add ignore_files to user init
2022-10-19 22:23:01 -04:00
Adam 1c5936e697 Fixup minor drawing issue. 2022-10-18 16:01:32 -04:00
Guldoman decbac4ac6
Check if scrollbar is no longer hovered on mouse release 2022-10-16 04:43:15 +02:00