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

10612 Commits

Author SHA1 Message Date
Maxime Coste
60fcc3443e Change ui_out -until-grep to check for equality the next argument
Instead of outputing the matching output, either ignore the output
(if not extra argument is given) or match it.

Usage is: ui_out -until-grep <pattern> [<expected>]
2024-11-04 07:15:34 +11:00
Maxime Coste
be82047dbf Only check for ascii horizontal blanks during command parsing
The general is_horizontal_blank supports various unicode blanks,
but passing an utf8 continuation byte to it can lead to surprising
results as we can match with 0xA0 (when char is unsigned).

Fixes #5250
2024-10-28 12:21:09 +11:00
Maxime Coste
b96e500ddb Fork server to background on <c-z> if session is daemonized
Fixes #4957
2024-10-22 21:34:31 +11:00
Maxime Coste
7b18d5e1be Add missing test file 2024-10-22 21:26:11 +11:00
Maxime Coste
50917b39ca Remove now unused CompletionFlags
Since shell-script-completions now runs the script asynchronously
and unconditionally, there is no use for the CompletionFlags::Fast
anymore which means we can remove that type altogether.
2024-10-22 21:18:23 +11:00
Maxime Coste
ca7bc55cf5 Run shell-script-completions asynchronously
Share most logic with shell-script-candidates. Now that we do not
block we can run the completion script implicitely instead of waiting
for an explicit completion request with <tab>.

Fixes #5245
2024-10-22 21:18:23 +11:00
Maxime Coste
63ccc61c1d Merge branch 'readme' of https://github.com/hadronized/kakoune 2024-10-22 08:20:19 +11:00
Maxime Coste
ea756d5971 Merge remote-tracking branch 'yoshiyoshyosh/spell' 2024-10-22 08:19:30 +11:00
Maxime Coste
ac0db62181 Merge remote-tracking branch 'VeeDeltaVee/make-dir-fix' 2024-10-22 08:18:21 +11:00
Maxime Coste
81bfef94fa Merge remote-tracking branch 'mixi/install-fix' 2024-10-22 08:17:21 +11:00
Johannes Altmanninger
063c35222b rc ctags: remove obsolete -markup switch
menu no longer supports the -markup switch since 1f1152983 (rc
tools menu: replace menu builtin with a prompt-based implementation,
2023-11-20). That commit removed all markup that ctags passes to menu
but didn't bother to remove -markup switch (because it's ignored).

Let's remove the switch to avoid the need for escaping "{".

Closes #5244
2024-10-22 08:15:59 +11:00
Johannes Nixdorf
eb74f7fcbf Require mandir to be create before installing the man pages
Otherwise parallel installation may fail with:

 cp -f doc/kak.1 $(DESTDIR)/usr/share/man/man1
 cp: cannot create regular file '$(DESTDIR)/usr/share/man/man1': No such file or directory
2024-10-19 13:37:50 +02:00
Johannes Nixdorf
c95034e5f1 Johannes Nixdorf 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.
2024-10-19 13:37:50 +02:00
Versha Dhankar
78c7c20d0e
Update README to point to root Makefile
In b05295, the project switched from a root Makefile that simply pointed
to the "real" Makefile in src/, and made the root Makefile contain all
the build logic.

However, the documentation wasn't updated to reflect this change. I'm
updating the README.asciidoc file to point to the new location of the
file, to avoid further confusion
2024-09-28 21:40:33 -07:00
Versha Dhankar
9e5ca1bb05
Versha Dhankar 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.
2024-09-28 21:20:27 -07:00
Dimitri Sabadie
7473d126ef
Make the client/architecture less confusing in the README.
Some people (i.e. in the Doom Emacs discord) mentioned being confused at that
X11 thing. The last commit that touched that line was in 2014, so I think
providing more up-to-date examples should remove any confusion.
2024-09-24 18:48:06 +02:00
yosh
1a2bf04f1b Rework spell-next and add spell-prev command
Take use of the fact that awk's FS already uses regex for splitting
to eliminate the usage of sub() within the actual awk program.
2024-09-22 23:37:04 -04:00
Passw
5e0f9a2ce0 add header file #incldue "format.hh" to fix building error about missing hex(...) function 2024-09-19 18:56:29 +08:00
Johannes Altmanninger
0e225db00e rc git: don't require client in git show-diff
This fails because the new logic wrongly assumes the presence of a client:

    hook global WinCreate /.* 'git show-diff'

The "diff" process hangs because we never write to ${kak_response_fifo}.
After a "pkill diff", the *debug* buffer shows

    error while waiting for shell: 1:1: 'evaluate-commands': 3:13: 'execute-keys': no such client: '-draft'
    shell stderr: <<<

The client argument is completely unnecessary since we always want
to use the calling context's buffer anyway. Remove it.

Note that we can probably further simplify this by using "write"
instead of a shell process. I'll send that patch along a few other
error handling improvements later.

Closes #5235
2024-09-18 20:52:44 +01:00
Johannes Altmanninger
4b71eedbae rc git: fix show-diff and apply for BSD sed 2024-09-18 20:52:44 +01:00
Chris Webb
b4b3ddae0d Avoid stdin as a function parameter name
9275d96 introduces a use of stdin as a function parameter name, but POSIX
allows stdin to be a macro, which will conflict with this. This breaks
the build on musl systems.

Rename in the same way as the previous fix for this in c7d887d.
2024-09-17 13:37:54 +01:00
Maxime Coste
2e1e15106e Rename Window::display_position to display_coord 2024-09-16 07:39:21 +01:00
Maxime Coste
88fa43988a Do not return beginning of buffer whenever display to buffer coord fails
Use an empty Optional to show that resolution failed and just do not
do anything in the mouse event handler in that case.
2024-09-16 07:25:02 +01:00
Maxime Coste
daa7e37ed1 Merge remote-tracking branch 'sjjf/sql_filetype_misdetection' 2024-09-16 15:40:54 +10:00
Johannes Altmanninger
b0e21a150e Fix "git blame" inside "git blame-jump" diff buffers
I used to use a patch that removes cd_bufdir so I didn't notice this
being broken for *git* buffers.
2024-09-16 15:24:20 +10:00
Johannes Altmanninger
54992c08ae rc git: teach "git apply" to work on content, not just diffs
Staging/unstaging/reverting (parts of) the current buffer's file can
be a common use case.

Today "git apply" can do that based on a selection within a diff.
When the selection is on uncommitted content, we can probably assume
that the intent is to use the part of the selection that overlaps
with the +-side of "git diff" (or "git diff --cached" for
"git apply --cached").

Make "git apply" treat selections as content if the buffile is
tracked by Git. This differentiator is not perfect but I don't know
why anyone would want to use the existing "git apply" semantics on
a tracked file. Maybe we should pick a different name.

This feature couples well with "git show-diff", which shows all
lines with unstaged changes (in future it should probably show staged
changes as well).

Whereas on diffs, "git apply" stages the entire hunk if the selection
contains no newline, this does not happen when operating on content.
I didn't yet try implementing that.  I guess the hunks are not as
explicit here.

Closes #5225
2024-09-16 15:23:18 +10:00
Johannes Altmanninger
aac32e0f5a patch-range.pl: extract peculiarities
We pipe the output of the patch program to stderr (to have it show
up in *debug*) and print to stdout the remaining diff (the part of
the diff that was not passed to patch).

The next patch wants to use this script in a different way, so move
these decisions up.
2024-09-16 15:23:18 +10:00
Johannes Altmanninger
4f5001b4d3 diff-parse.pl: don't force error message into register
A following patch wants to use this script without wrapping it in an
"evaluate-commands -save-regs e %{ ... }", so simply print the raw
error message and set the register to the caller.

This interface is a bit weird because the error is printed quoted
but for now that just makes things a bit more convenient.
2024-09-16 15:23:18 +10:00
Johannes Altmanninger
ed4729a265 rc git: show-diff to honor unsaved buffer modifications
If a file has unsaved modifications, then the show-diff flags below
such modifications will be wrong.  Fix this by using the current
buffer contents, just like the git blame integration does.
This might make it a bit slower, I haven't tested that.
2024-09-16 15:23:18 +10:00
Johannes Altmanninger
314e69fc37 rc git: rationalize blame fifo usage
We call git blame
a. asynchronously in ":git blame"
b. synchronously in ":git blame-jump"

In both cases we
1. create a fifo
2. buffer the file contents in shell memory
3. print to the fifo
4. run git blame and remove the fifo

For the synchronous case the buffering and custom fifo is not
necessary; use ${kak_response_fifo} instead.

For the asynchronous case we do need a buffer that outlives the
enclosing %sh{} block. Buffering in shell memory can be somewhat slow
for large files.  Let's use a temporary file instead.
2024-09-16 15:23:18 +10:00
Johannes Altmanninger
fab8a7ef3c rc git: simplify git diff invocation
If stdout is not a TTY, Git never calls a pager, so this is
unnecessary.
2024-09-16 15:23:18 +10:00
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
yosh
4f9020aa0e yosh 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.
2024-09-09 20:24:50 -04: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
Simon Fowler
48f7242276 Match against .sql extension, not sql suffix.
The SQL filetype detection currently matches against a 'sql' suffix on
the filename, which incorrectly matches a filename like 'run-psql'.
Instead, explicitly match against a '.sql' suffix.
2024-08-31 13:44:03 +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