1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-25 21:16:38 +03:00
Commit Graph

10210 Commits

Author SHA1 Message Date
Maxime Coste
dd5b624003 Merge remote-tracking branch 'divarvel/show-trailing-whitespace' 2023-09-08 05:50:11 +10:00
Maxime Coste
f21145c249 Merge remote-tracking branch 'QiBaobin/filetype-grovvy' 2023-09-08 05:28:56 +10:00
Maxime Coste
76306f7c05 Merge remote-tracking branch 'raiguard/rc/go-highlighting' 2023-09-08 05:28:08 +10:00
Maxime Coste
0a54012f8e Merge remote-tracking branch 'QiBaobin/spell-sed' 2023-09-08 05:27:05 +10:00
Maxime Coste
9787756619 Use last display setup instead of recomputing for window_range
Fixes #4964
2023-09-08 05:24:56 +10:00
Maxime Coste
9b1f4f5f20 Do not make cursor visible on force redraw 2023-09-08 05:24:56 +10:00
Bob Qi
8f6ef9512f add groovy filetype 2023-09-07 09:52:00 +08:00
Caleb Heuer
142925fc90 This is numerics, not identifiers 2023-09-06 12:24:06 -06:00
Caleb Heuer
c338efe078 Support generics in function highlighting 2023-09-06 12:03:49 -06:00
Caleb Heuer
6148a16a0e Add spread operator 2023-09-06 12:03:49 -06:00
Caleb Heuer
88bb854f36 Improve Go highlighting 2023-09-06 12:03:49 -06:00
Bob Qi
c6270512fd fix a sed error on mac
sed: 1: "/^&/ { s/^[^:]*: //; s/ ...": extra characters at the end of p command
2023-09-05 14:48:26 +08:00
Maxime Coste
20a2bca52e Do not make cursor visible after mouse scrolling and view commands
ensure cursor is visible after user input except if the command
implementation opted-out. Hooks and timers should not enforce
visible cursor.

PageUp/PageDown and `<c-f>` / `<c-b>` commands still move the cursor
as this seemed a desired behaviour.
2023-09-02 12:55:57 +10:00
Maxime Coste
6990270005 Still inkorrect inglish
Hopefully thats better now
2023-08-31 04:56:50 +10:00
Maxime Coste
a212fd25a0 Fix incorrect inglish 2023-08-29 03:24:27 +10:00
Maxime Coste
e4d7b884cd Cleanup SIGHUP handling and forking server to background
Ensure we ignore SIGHUP once the TerminalUI is gone as it will be
sent again on fork, fix the parent process terminating due to trying
to write to stdout after it was closed.

Fixes #4960
2023-08-27 08:47:33 +10:00
Maxime Coste
cd4a695f41 Add regression test for #4959
Thanks @krobelus
2023-08-27 08:12:58 +10:00
Maxime Coste
7e86230c61 Merge remote-tracking branch 'arachsys/create-default-region' 2023-08-27 08:11:07 +10:00
Maxime Coste
fe93a9df37 Remove Window::force_redraw()
This was mostly redundant with Client::force_redraw.
2023-08-27 08:03:42 +10:00
Maxime Coste
6f9f32b4bb Small code cleanup in winow.cc/hh 2023-08-27 07:01:50 +10:00
Maxime Coste
9c0c6b8fd5 Revert "Only make cursor visible after buffer or selection change"
This is currently broken on various corner cases and breaks the
"master branch should be good for day to day work" implicit rule,
ongoing work to stabilize this feature will take place on the
no-cursor-move-on-scroll branch until its deemed ready.

This reverts commit 1e38045d70.

Closes #4963
2023-08-23 14:13:22 +10:00
Maxime Coste
1e38045d70 Only make cursor visible after buffer or selection change
Kakoune now does not touch cursors when scrolling. It checks
if either the buffer or selections has been modified since
last redraw.

Fixes #4124
Fixes #2844
2023-08-16 21:02:42 +10:00
Chris Webb
491d4d47ae Fix segfault when adding an invalid default-region highlighter
RegionsHighlighter::create_region() validates the highlighter type argument
but RegionsHighlighter::create_default_region() assumes it is correct,
segfaulting from dereferencing a null pointer if the given type isn't in
the highlighter registry HashMap.

@PJungkamp reported this in https://github.com/mawww/kakoune/issues/4959
with a simple recipe to reproduce:

    :add-highlighter shared/test regions
    :add-highlighter shared/test/ default-region invalid highlighter
    :add-highlighter window/test ref test

Validate the type argument in RegionsHighlighter::create_default_region()
in the same way as RegionsHighlighter::create_region().
2023-08-15 16:22:39 +01:00
Maxime Coste
6942a4c0c9 Change + command not to duplicate identical selections more than once
The current exponential behaviour does not seem that useful, it seems
more predictible that pressing `+` twice would end up with 3 copies
of the original selections instead of 4.

Fixes #4533
2023-08-14 22:50:22 +10:00
Maxime Coste
0a06d9acbd Minor formatting tweaks 2023-08-13 03:57:46 +10:00
Maxime Coste
e090131b87 Add a ProfileScope helper class to replace most profiling uses 2023-08-13 03:57:46 +10:00
Maxime Coste
e605ad8582 Kakoune 2023.08.05 2023-08-05 11:02:11 +10:00
Maxime Coste
39be51b55c Fix regression/0-mouse-during-insert test flakyness
Do not rely on timing but wait for Kakoune to redraw which is what
we actually need: Mouse clicks rely on the current display buffer
to resolve the buffer location, so we need to wait for a redraw
to happen with `ui_out`
2023-08-05 10:58:15 +10:00
Maxime Coste
d7822ea588 Removed unused captures 2023-08-05 10:39:54 +10:00
Maxime Coste
d1e189f1bf Try to fix clang build issues 2023-08-05 10:34:16 +10:00
Michał Kruszewski
521549fb69 troff: Highlight .PSPIC and .PDFPIC macros 2023-07-30 09:47:10 +02:00
Maxime Coste
f58d686066 Kakoune 2023.07.29 2023-07-29 15:53:23 +10:00
Maxime Coste
dad128e4a6 Merge remote-tracking branch 'QiBaobin/rc/windowing/wezterm' 2023-07-29 15:34:15 +10:00
Maxime Coste
90acec991f Merge remote-tracking branch 'omasanori/ocaml-lex-and-yacc' 2023-07-29 15:33:48 +10:00
Maxime Coste
991b233468 Merge remote-tracking branch 'arrufat/zig-builtin-functions' 2023-07-29 15:33:15 +10:00
Maxime Coste
f4fd1d75ca Merge remote-tracking branch 'arrufat/zig-zon' 2023-07-29 15:32:37 +10:00
Bob Qi
117f12dbd6 pass cwd for wezterm terminal 2023-07-27 13:28:37 +08:00
Masanori Ogino
8fb0a99f05 Detect .mll and .mly files as OCaml sources 2023-07-26 17:15:06 +09:00
Adrià Arrufat
fdb33e7302 zig: add c_char type 2023-07-26 12:37:35 +09:00
Adrià Arrufat
ca36d0d228 zig: update builtin functions for v0.11.0 2023-07-26 12:26:49 +09:00
Adrià Arrufat
eabc7cd2a8 Set filetype to Zig for zon files. 2023-07-25 15:30:52 +09:00
Johannes Altmanninger
12310418b0 Allow map/unmap during mapping execution
Commits e49c0fb04 (unmap: fail if the mapping is currently executing,
2023-05-14) 42be0057a (map: fail if key is currently executing,
2023-06-24) fixed potential use-after-free issues. By doing so,
it broke configurations that in practice have not triggered any
crashes [1] [2].

For example with,

	set -remove global autocomplete insert
	hook global InsertCompletionShow .* %{
	    map window insert <esc> <c-o>
	}
	hook global InsertCompletionHide .* %{
	    unmap window insert <esc> <c-o>
	}

The execution of the <esc> mapping triggers InsertCompletionHide fails
at unmapping. This seems legit and I don't see an obvious alternative
way to write it (InsertIdle would not be correct though it would work
in practice).

Fix the regression by allowing map and unmap again while keeping the
mappings alive until they have finished executing.

Applying map/unmap immediately seems like the most obvious semantics.
Alternatively, we could apply them in between key presses.

[1]: <https://github.com/kak-lsp/kak-lsp/issues/689>
[2]: <https://github.com/alexherbo2/auto-pairs.kak/issues/60>
2023-07-20 09:18:23 +02:00
Maxime Coste
e3122ab2c1 Refactor prompt history handling
Share incremental regex logic, pass the synthetized nature of keys
through to input handlers.
2023-07-05 22:00:32 +10:00
Maxime Coste
ec79864559 Merge remote-tracking branch 'krobelus/allow-history-in-mappings' 2023-07-05 20:39:39 +10:00
Maxime Coste
3fae7cd7c0 Merge remote-tracking branch 'arrufat/zig-auto-remove-empty-comments' 2023-07-04 19:33:37 +10:00
Maxime Coste
96ff68aeae Merge remote-tracking branch 'krobelus/fix-remap-uaf' 2023-07-04 19:33:10 +10:00
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
Johannes Altmanninger
42be0057a6 map: fail if key is currently executing
If during execution of a mapping, that same mapping is replaced,
there is undefined behavior because we destroy a mapping that we are
still iterating over.

I have been using this mapping inside my kakrc to re-source the kakrc.

	map global user s %{:source "%val{config}/kakrc"<ret>} -docstring 'source "%val{config}/kakrc"'

Now <space>s happens to not trigger undefined behavior because the
mapping stays the same.

However it triggers an assertion added by Commit e49c0fb04 (unmap:
fail if the mapping is currently executing, 2023-05-14), specifically
the destructor of ScopedSetBool that guards mapping execution.

Fix these by banning map of a key that is executing, just like we
did for unmap.

Alternative solution: we could allow mapping (and even unmapping)
keys at any time and keep them alive by moving them into a trash can,
like we do for clients and others.
2023-07-03 19:03:11 +02:00
Maxime Coste
661d1a0905 Merge common docstring in key mapping assistant
Fixes #4942
2023-07-03 20:48:59 +10:00