1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-27 02:23:26 +03:00
Commit Graph

10579 Commits

Author SHA1 Message Date
Johannes Altmanninger
c93705b4cc rc filetype diff: diff-jump to use location at main selection, not the last one
The jump command does the same.
2024-09-16 15:23:18 +10:00
Maxime Coste
be5f059f26 Merge remote-tracking branch 'arrufat/patch-1' 2024-09-09 19:57:45 +10:00
Maxime Coste
fce4c05e37 Merge remote-tracking branch 'arrufat/zig-builtins' 2024-09-09 19:57:27 +10:00
Maxime Coste
040f683ca6 Remove out-of-date documentation about <esc> ending macro recording
Fixes #5223
2024-09-08 22:01:14 +10:00
Maxime Coste
7e05dc8d2e Add terminal_title terminal ui_option to control the title
Use a separate option from terminal_set_title for simplicity.

Fixes #2217
Closes #4265
2024-09-08 21:59:27 +10:00
Adrià Arrufat
0c47774bd6 Add new Zig builtins 2024-09-06 10:29:38 +09:00
Adrià
c0118f2fba
Remove trailing space in scopes.asciidoc
Closes #5226
2024-09-05 16:06:26 +09:00
Maxime Coste
c1ce1d7014 Explicitely call try_accept on InsertCompleter
Calling it as part of the insert method was error prone and often
led to slightly surprising behaviour, such as the <c-r><esc> hiding
the menu on <esc>.
2024-09-02 20:35:07 +10:00
Johannes Altmanninger
6e5bc9dd6c Fix <c-r> use-after-free InsertCompletionHide touches used register
Before performing the insertion, InsertCompleter::insert calls
try_accept() to accept any selected completion candidate.  If there
is one, we fire InsertCompletionHide. If that one modifies the register
used by <c-r>, the inserted StringViews will be dangling.

Fix this by running try_insert first, and read from the register later.
Note that we call try_accept() twice but that's fine.

It would probably make more sense to copy the register before calling
insert() but I don't think it matters.

Closes #5220
2024-09-02 19:46:33 +10:00
Maxime Coste
9275d965a6 Do not gather full input data in a single string when piping
Refactor ShellManager and pipe to feed lines from the buffer directly,
this should reduce memory use when piping big chunks of buffers.

The pipe output is still provided as a single big buffer.
2024-08-26 21:00:08 +10:00
Maxime Coste
202747e688 Fix includes for debug build
Looks like we've been over eager with removing unused includes and
did not realize they were only unused in optimized builds.
2024-08-26 20:23:32 +10:00
Maxime Coste
d1554b969e Merge remote-tracking branch 'arrufat/update-double-underline-main' 2024-08-26 19:19:59 +10:00
Chris Webb
193d4ba023 Add back <cwchar> for wcwidth in src/unicode.hh
On a musl system with clang 18.1.8 linking against libc++, 64ed046e breaks
the build with

  src/unicode.hh:105:24: error: use of undeclared identifier 'wcwidth'
    105 |     const auto width = wcwidth((wchar_t)c);

though this doesn't happen on the same system with gcc 14.2.0 linking
against libstdc++.

Include <cwchar> again so wcwidth() is properly defined.
2024-08-24 14:36:09 +10:00
Maxime Coste
29d0596c71 Merge remote-tracking branch 'arrufat/includes-cleanup' 2024-08-19 08:13:45 +10:00
Johannes Altmanninger
f4d8a831ff Don't interpret the \n input byte as <ret>
We set both ICRNL and INLCR, so there is no translation of \r to \n
and vice versa.  This means that when the user presses the Enter key,
we always receive \r.
So a "\n" input byte can realistically only be sent by <c-j> (or
perhaps <c-J>), so we can interpret it as that.

This intentionally breaks users that rely on <c-j> doing the same
thing as <ret> on terminals that fail to disambiguate those two
(for example gnome-terminal).
This seems unavoidable; better teach them to map <c-j> separately
sooner rather than later.
2024-08-19 08:11:27 +10:00
Johannes Altmanninger
2c923ba827 Decode XTerm's formatOtherKeys=0 encoding
When typing <s-ret>, XTerm sends

    \e[27;2;13~

Only when formatOtherKeys is set to 1 by the user, XTerm will send
an equivalent CSI u encoding.
2024-08-19 08:11:27 +10:00
Johannes Altmanninger
59ca840a65 Decode kitty keyboard protocol's numlock keys
Fixes numlock input on Alacritty.

Closes #5214
2024-08-19 08:11:27 +10:00
Adrià Arrufat
64ed046e5a include headers cleanup 2024-08-16 08:49:19 +09:00
Adrià Arrufat
221a538b45 Add double underline in main version notes 2024-08-15 23:19:24 +09:00
Maxime Coste
288db58d20 Remove some more unnecessary includes 2024-08-15 12:58:25 +10:00
Maxime Coste
65ac5d42c9 Remove unused ConstexprVector and rename constexpr_utils.hh to array.hh 2024-08-15 12:58:25 +10:00
Maxime Coste
b804693630 Remove unused wrap_to and reduce string_utils headers 2024-08-14 22:04:52 +10:00
Maxime Coste
449adb14a5 Remove tuple use from ranges.hh 2024-08-14 22:04:52 +10:00
Maxime Coste
01cb818c20 Reduce number of included headers 2024-08-14 22:04:35 +10:00
Maxime Coste
575f49f1b4 Merge remote-tracking branch 'lenormf/fix-3972' 2024-08-14 21:32:42 +10:00
Maxime Coste
203e3704d8 Fix json-ui scroll support
Add cursor coordinate parameters, and fix encoding to match the
new one.
2024-08-14 21:32:03 +10:00
Maxime Coste
a553ed5aa1 Merge remote-tracking branch 'ericv8v9s/master' 2024-08-14 21:11:04 +10:00
Maxime Coste
b7c014ba4f Merge remote-tracking branch 'enricozb/enricozb/scroll-coordinates' 2024-08-14 21:09:53 +10:00
Maxime Coste
a0a000951e Merge remote-tracking branch 'arrufat/support-double-underline' 2024-08-14 21:06:14 +10:00
Maxime Coste
c8f8548130 More include fixes 2024-08-14 20:35:04 +10:00
Maxime Coste
7a60ae9a7f Add missing include for non libstdc++ builds 2024-08-14 20:32:52 +10:00
Maxime Coste
df80aef04b Bump freebsd build to latest
The freebsd/13.x image seems to be failing at the moment
2024-08-14 20:30:31 +10:00
Maxime Coste
f25dc419c7 More test timing fix 2024-08-14 19:12:49 +10:00
Maxime Coste
238e5e7659 Try to make tests less timing sensitive 2024-08-13 20:39:44 +10:00
Maxime Coste
560e3631ec Move debug utils to debug.hh/debug.cc
Lots of code includes buffer_utils.hh just for write_to_debug_buffer
which pulls many unnecessary dependencies. Reorganise to reduce
compile times.
2024-08-12 20:02:11 +10:00
Maxime Coste
6ed01f402b Reduce headers dependency graph
Move more code into the implementation files to reduce the amount
of code pulled by headers.
2024-08-12 20:02:11 +10:00
Maxime Coste
1b2100753e Reduce exposed headers from context.hh 2024-08-12 20:02:11 +10:00
Maxime Coste
1a52006c3d Extract format implementation to its own file
Split it to avoid pulling all string_utils dependencies for just
format.
2024-08-12 20:02:11 +10:00
Maxime Coste
2d9886afe7 Remove void_t and use requires instead 2024-08-12 20:02:11 +10:00
Maxime Coste
a250b96c18 Move most info/status clear logic to client
This makes it possible to remove the pending clears whenever an
info/status line is explicitely added, removing a class of race
conditions introduced by the previous implementation.
2024-08-12 17:10:12 +10:00
Eric
d15208fc19
Fixed highlighter marking everything as ruby string in ERB files 2024-08-09 09:33:56 -04:00
Maxime Coste
6af7a847c7 Delay NormalMode clearing of status line and info box to next idle
A common pattern is for info/echo messages to be generated by idle
hooks but the clearing of previous info/echo was done immediately on
normal mode events. This led to flickering of the info box especially
when a hook was repeatidly generating the same info (like moving
a cursor in the same word where the hook reacts to the word under
the cursor).
2024-08-08 13:08:01 +10:00
Thomas Teixeira
31e0c81156 Add gleam language support 2024-08-06 22:15:01 +10:00
Thomas Teixeira
3dcc042fb4 Thomas Teixeira 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.
--
2.45.2
2024-08-06 22:14:28 +10:00
Enrico Zandomeni Borba
0fddb3fef8 fix mouse scrolling 2024-08-06 09:03:38 +02:00
Johannes Altmanninger
ef18d3cbfb rc make/grep: evaluate makecmd in calling context, use eval semantics again
I configured :make to use a special makecmd for files called test.cpp.

	hook global BufCreate .*/test.cpp %{
		set-option buffer makecmd "g++ %val{buffile} && ./a.out"
	}

Commit c93cb5c4d (Add a `fifo` helper command and refactor `make`
and `grep` to use it, 2024-06-07) made :make evaluate makecmd in the
toolsclient context instead of the calling context, so my buffer-local
override no longer applies. I'm not sure if this is something we want
to guarantee but it doesn't seem unreasonable, and we can fix it a
no cost I think.

Additionally, it changed

    eval "${kak_opt_makecmd}" "$@";

to

    $kak_opt_makecmd "$@"

meaning that the "&&" in my makecmd will no longer be evaluated.
Instead it will be passed as argument to g++, effectively

    g++ %val{buffile} '&&' ./a.out

which I don't think is a reasonable expectation (unless we change
makecmd to be str-list options).  Essentially, the above only applies
word splitting to makecmd; it seems simpler and less surprising to
treat them as raw shell commands.

Expand makecmd in the calling client again, and insert it verbatim
into the shell script.

grep hasn't needed it so far but keep it consistent.
2024-08-05 19:14:48 +10:00
Enrico Zandomeni Borba
f2e7498ccc fix mouse coord underflow
previously, clicking on the status line if it is on the top of the
window results on a coord.line = 1 << 16, or there abouts. This is
because the expression

  (key & 0xFFFF0000) >> 16

results in an `shr` instruction which does not propagate the sign
bit. Mouse event coordinates can be negative if the status line is
on top and the status line is clicked. The new line

  (int32_t) (key & 0xFFFF0000) >> 16

properly propagates the sign bit, leading to the correct signed
numeric line coordinate.
2024-08-04 21:28:21 +02:00
Enrico Zandomeni Borba
e7605b4ec9 Enrico Zandomeni Borba
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.
2024-08-04 17:41:27 +02:00
Enrico Zandomeni Borba
7093f14291 add scroll coordinates
adds scroll amount in the upper 16-bits of `Key.modifiers`, reclaiming
the space in `Key.key` for coordinates. Previously, while mouse events
included their coordinates, scrolling did not. Scroll events are now
emitted as <scroll:amount:line.column>.
2024-08-04 17:40:29 +02:00
Adrià Arrufat
2ab35fbb23 Add support for double underline 2024-08-04 20:55:21 +09:00