Commit Graph

10058 Commits

Author SHA1 Message Date
Adrià Arrufat
3cca4c5098 Auto-remove empty comments in Zig like in the C-family.
This makes Kakoune behave more consistently when using it for Zig.
Empty comments are already auto-removed from the C-family and Python.
In this PR, string literals that start with \\ are not removed in purpose.
2023-07-04 16:40:24 +09:00
Maxime Coste
53fed4b8b9 Only auto-insert completion when at the end of the line
Auto inserting in the middle is annoying more often than not.
2023-07-04 17:15:33 +10:00
Maxime Coste
661d1a0905 Merge common docstring in key mapping assistant
Fixes #4942
2023-07-03 20:48:59 +10:00
Maxime Coste
4b605c582c Merge remote-tracking branch 'omasanori/fixup-undo-doc' 2023-07-03 20:14:21 +10:00
Maxime Coste
4f60a828cd Merge remote-tracking branch 'ericv8v9s/master' 2023-07-03 20:06:01 +10:00
Maxime Coste
74b0bf6c9e Merge remote-tracking branch 'GrantMoyer/patch-1' 2023-07-03 20:04:00 +10:00
Maxime Coste
2cd14860e0 Merge remote-tracking branch 'newsch/sql-comments' 2023-07-03 20:02:47 +10:00
Eric
a9b52b315c Fixed lisp highlighter marking everything as variable 2023-07-01 15:27:13 +08:00
Eric
eca127cfab Eric Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2023-07-01 15:11:24 +08:00
Sergey Fedorov
dca5043812 Unbreak build on ppc
Fixes: https://github.com/mawww/kakoune/issues/4937
2023-06-27 12:29:45 +08:00
Grant Moyer
7115858093
Quote doc file path in doc-render command
Without quoting the file path,
the `doc` command fails to display any docs with spaces or backslashs (on Cygwin) in their paths.
2023-06-23 12:38:19 -04:00
Evan Lloyd New-Schmidt
c1e6fe4ca1 Add standard SQL comments 2023-06-21 16:48:24 -07:00
Maxime Coste
e06e409dc1 Another small structured binding conversion 2023-06-21 17:36:33 +10:00
Masanori Ogino
58058d1213 Fixup documentation on history navigation commands
Co-authored-by: Johannes Altmanninger <aclopte@gmail.com>
2023-06-21 10:25:59 +09:00
Maxime Coste
e365c42b4b Small structured binding conversion 2023-06-20 19:32:06 +10:00
Maxime Coste
d43268fbeb Fix invalid access of display line end
When a line only contains non-range atoms we can end-up accessing
past the end atom.

Add a test that shows the issue when run with valgrind, it is
unfortunately quite hard to trigger a crash because the invalidly
accessed byte usually leads to the correct code path being taken
(when != DisplayAtom::Range) so we have only 1 in 255 chance of
triggerring a crash.

Fixes #4927
2023-06-20 13:09:03 +10:00
Maxime Coste
e58592f00a Fix highlighters being applied to empty display buffers
In some cases such as with folding we can end-up with regions
not having any atoms to highlight which can trigger a crash as
we assume display buffers not to be empty

Fixes #4926
2023-06-19 12:55:55 +10:00
Maxime Coste
7027cccf82 Fix typo in README 2023-06-17 18:14:15 +10:00
Maxime Coste
5901d2e06b Revert "Switch undo storage from a tree to a plain list"
Moving across history moved to <c-j>/<c-k> to keep <a-u>/<a-U>
for selection undo/redo

This reverts commit e0d33f51b3.
2023-06-17 17:31:57 +10:00
Maxime Coste
b2a853cfc2 Add a few missing entries to the changelog 2023-06-17 17:10:05 +10:00
Maxime Coste
18d4c40f08 Fix c-family closing brace indent behaviour on some corner cases 2023-06-15 17:42:19 +10:00
Maxime Coste
5b1ad0bd0c Add a -previous switch to show-matching highlighter
This switch makes show-matching fallback to the character preceeding
the cursor if the character under the cursor is not a matching
character, which should make show-matching more useful in insert mode.
2023-06-14 22:53:39 +10:00
Maxime Coste
4106791adc Fix windowing detection echoing last module error if none matched
Display a more general message in the debug buffer.
2023-06-13 17:08:42 +10:00
Maxime Coste
19cbb703a7 Merge remote-tracking branch 'arrufat/fix-build-gcc13' 2023-06-12 21:53:39 +10:00
Maxime Coste
467021c3c7 Merge remote-tracking branch 'arrufat/remove-unneeded-this-capture' 2023-06-12 21:51:13 +10:00
Maxime Coste
93219af001 Merge remote-tracking branch 'QiBaobin/wezterm' 2023-06-12 21:50:18 +10:00
Maxime Coste
ca4593e5cd Fix one missing face pre-parsing 2023-06-12 17:12:24 +10:00
Maxime Coste
6984340936 Store region pointers instead of names in the RegionsHighlighter cache
Cache get fully invalidated whenever the regions change, so there
should be no risk of referencing a removed region, and this removes
one hash map lookup for every region in the displayed buffer range.
2023-06-12 16:45:19 +10:00
Maxime Coste
af66a95ef8 Trim display lines before the colorize pass
Colorizing long lines can be costly, remove all the invisible atoms
earlier. Also optimize ForwardHighlighterApplier further by trimming
empty lines.
2023-06-12 16:26:22 +10:00
Maxime Coste
5a867ebdd1 Pre-parse face specs in Highlighters
Re-parsing face specs can be expensive as highlighters can
be called many times during a redraw with nested regions.
2023-06-10 09:46:46 +10:00
Adrià Arrufat
66b22a1902 Remove unneeded this capture in lambda
Clang 15 was complaining about this.
2023-06-09 21:47:49 +09:00
Adrià Arrufat
77ade51a81 Fix build using GCC 13.1
The <functional> header was missing and the "hash.hh" was not used.
2023-06-09 21:41:51 +09:00
Bob Qi
365fe58826 fix arg quoting 2023-06-09 17:57:48 +08:00
Bob Qi
b64dce3e95 rc/windowing/wezterm.kak 2023-06-09 15:43:07 +08:00
Maxime Coste
e0728d3434 Speed up regions highlighting on files with big lines
Range atoms should always appear in order, so we can iterate a single
time through the display lines and display atoms while applying
hightlighters to regions
2023-06-09 16:38:14 +10:00
Maxime Coste
5a31d331b9 Merge branch 'patch-1' of http://github.com/DerSaidin/kakoune 2023-06-05 20:13:49 +10:00
Maxime Coste
6bee11c7dd Merge remote-tracking branch 'QiBaobin/kakrc-hl' 2023-06-05 20:13:07 +10:00
Maxime Coste
0338294223 Merge remote-tracking branch 'greenfork/hare-comment-insert' 2023-06-05 20:11:23 +10:00
Dmitry Matveyev
caf6f6ff7e hare.kak: change back the command
Previously was changed in

https://github.com/mawww/kakoune/pull/4785

Probably some race condition that right now works with a big letter P?
2023-06-04 09:49:52 +06:00
Johannes Altmanninger
b7e9d9bae3 rc detection modeline: optimize modeline pre-filtering
modeline-parse leads by matching an expensive regex against the entire buffer,
which can take a long time on huge files.

Perl takes too long on this regex and it seems not even ripgrep
optimizes the \z component

	$ ruby -e '10000.times { puts "a" * 10000 }' > big
	$ time rg --multiline --only-matching '\A(.+\n){1,5}|(.+\n){1,5}\z' big | wc -l
	10
	__________________________
	Executed in  419.81 millis
	   usr time  399.84 millis
	   sys time   20.78 millis

where

	$ time kak big -e q
	__________________________
	Executed in  179.19 millis
	   usr time  133.61 millis
	   sys time   53.50 millis

Let's lose the regex.

Fixes #4911
2023-06-02 22:38:32 +02:00
Bob Qi
acaca4955e add Highlight for complete-command shell-script 2023-06-02 15:31:41 +08:00
Andrew Browne
034f68394d
Update mapping.asciidoc for key swap.
https://github.com/mawww/kakoune/issues/2524
2023-06-01 10:25:12 -07:00
Maxime Coste
7f950bc4a9 git.kak: Use gawk's strftime instead of shelling out to date
`date -d` is not posix, strftime neither, but at least we only rely
on one non-posix tool and avoid forking.

Should help a bit for #4847
2023-05-30 13:01:56 +10:00
Maxime Coste
95a4d70379 Kill current shell on <c-g> during shell execution
Closes #4907
2023-05-29 20:25:56 +10:00
Maxime Coste
cf7c638025 Refactor KeymapManager to enfore setting is_executing on key iteration
Add an iterator based remove to HashMap as that was missing. Make
KeymapManager responsible for throwing on unmap an executing mapping.
2023-05-29 20:11:06 +10:00
Maxime Coste
3069b68245 Merge remote-tracking branch 'krobelus/fix-unmap-uaf' 2023-05-29 20:10:50 +10:00
Johannes Altmanninger
e49c0fb040 unmap: fail if the mapping is currently executing
When unmapping a key sequence that is currently executing, we continue
executing freed memory which can have weird effects.  Let's instead
throw an error if that happens. In future we can support unmap in
this scenario.

Closes #4896
2023-05-25 00:04:23 +02:00
Tim Allen
45c01c2109 Document the new <c-g> key, and <c-c> too while we're at it.
Sometimes we get people asking why <c-c> can't be mapped. It should be
mentioned in the `:help mapping` documentation, along with any other
unmappable keys.
2023-05-21 20:26:30 +10:00
Maxime Coste
cfa658b899 Add <c-g> to cancel current operation
The current implementation only does this during regex operations,
but should be extensible to other operations that might take a long
time by regularly calling EventManager::handle_urgent_events().
2023-05-21 16:20:51 +10:00
Maxime Coste
e140df8f08 Add an idle callback to be called regularly while regex matching
This paves the way towards being able to cancel long regex matching
operations
2023-05-21 16:20:51 +10:00