1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-07-07 09:16:26 +03:00
Commit Graph

10501 Commits

Author SHA1 Message Date
Maxime Coste
e0bbd1e7ca Merge remote-tracking branch 'PJungkamp/directory-changed' 2024-07-01 21:31:17 +10:00
Daniel Gorin
8ca7b5815a erlang: Fix the comment_line configuration
Erlang comments start with `%`. This is correctly highlighted
but the comment-line/comment-block commands don't work correctly.
2024-06-27 13:10:21 +01:00
Maxime Coste
80fcfebca8 Fix order of evaluation issue when compiling regex alternations
The previous implementation was relying on the left hand side of the
assignement's side effects to be sequenced before the right hand side
evaluation (so --split_pos was expected to have taken place)

This is actually counter to C++17 which guarantees evaluation of the
right hand side of the assignement first. For some reason this is
not the case with GCC on linux.
2024-06-26 22:38:01 +10:00
Maxime Coste
cbdd200e73 Fix corner case in passin arguments to grep and make 2024-06-26 20:35:34 +10:00
Philipp Jungkamp
0a10612786 Add EnterDirectory hook
This hook runs on `change-directory` and is also emitted just before
KakBegin after kakrc has been sourced.
2024-06-24 16:16:33 +02:00
Philipp Jungkamp
07000adb9b Philipp Jungkamp 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-06-24 16:16:33 +02:00
Maxime Coste
374a7a8c99 Remove some selection copies in pipe and throw early if read only
Throwing early avoids losing selections in this case.
2024-06-24 21:18:17 +10:00
Maxime Coste
6674fe7587 Merge remote-tracking branch 'stacyharper/elixir-heex' 2024-06-23 11:14:34 +10:00
Maxime Coste
4a00a6edea Fix trailing whitespaces 2024-06-23 11:03:50 +10:00
Tobias Pisani
6493ddad42 Allow individual show-whitespace options to be turned off
This is especially useful to use the indent guides without the  other
parameters, but in general it can be a useful option.

It could be worth considering cleaning up these options to default off instead, but
the default also seems useful, so i consider this ok, as it might be the more advanced
usecase.
2024-06-23 11:03:03 +10:00
Maxime Coste
880ad98a30 Add a -script switch to the fifo to cater for grep/make use cases
Avoid the brittle `exit; %arg{@}` trick
2024-06-22 17:02:54 +10:00
Willow Barraco
0bb355557e
elixir: detect heex additionaly to leex 2024-06-19 12:45:20 +02:00
Maxime Coste
ba504431dc Small code style tweak 2024-06-15 16:09:14 +10:00
Maxime Coste
c4684d0d84 Store instruction pointers directly in ThreadedRegexVM::Thread
The previous tradeoff of having a very small Thread struct is not
necessary anymore as we do not memcpy Threads on swap_next since
d708b77186.

This requires offsets to be used instead of indices for jump/split
ops.
2024-06-15 14:36:33 +10:00
Maxime Coste
c84942c2ac Add perf-annotate highlighting to perf.kak 2024-06-15 11:45:19 +10:00
Maxime Coste
700265b25d Bump cirrus CI linux_gcc memory to avoid OOM 2024-06-12 22:39:45 +10:00
Maxime Coste
8045712595 Bump cirrus CI freebsd to 13.3 2024-06-12 22:31:41 +10:00
Maxime Coste
966deb514e Add some static_asserts in SSO code 2024-06-12 20:18:00 +10:00
Maxime Coste
fe8f0f3371 Merge remote-tracking branch 'Icantjuddle/master' 2024-06-12 19:55:34 +10:00
Ben Judd
faf83b10e2 Switch to bitfield. 2024-06-11 08:33:35 -07:00
Maxime Coste
5a6fb51bdb Tweak python block command test location and remove wall of text
We do not typically go into lengthy explanation of the code in the
support scripts. This would have a performance impact (as comments
are not trimmed in advance) and feels out of place.
2024-06-11 19:39:07 +10:00
Maxime Coste
17c25cc86a Merge remote-tracking branch 'sjjf/python_comment_paras' 2024-06-11 19:33:33 +10:00
Coleman McFarland
a35a7dc4a4
Fix up %val{buflist} description in expansions.asciidoc
The output is not quoted by default. Fixes #5158
2024-06-10 19:43:08 -04:00
Ben Judd
9c185249a2 Fix build by moving include. 2024-06-07 17:54:06 -07:00
Ben Judd
2754e27cf2 Increase SSO from 22 to 23 chars. 2024-06-07 17:48:07 -07:00
Simon Fowler
9c9aa2cf95 Support paragraph breaks in python block comments.
The current python filetype module treats a single empty comment line
(typically created by hitting enter twice while in a block comment) as
the end of a block comment, deleting the empty comment and ending
comment prefix copying. This runs contrary to PEP8, which explicitly
allows for paragraphs in block comments, with an empty comment as the
paragraph separator.

This change implements support for using a single empty comment as a
paragraph separator, with two consecutive empty comments being treated
as the end of the block comment; both empty comment lines are deleted
and comment prefix copying is ended.
2024-06-07 20:33:17 +10:00
Maxime Coste
c93cb5c4d8 Add a fifo helper command and refactor make and grep to use it
Running arbitrary commands in a fifo is very useful in its own right
and factoring out the common pattern is a nice added cleanup.
2024-06-07 19:03:50 +10:00
Maxime Coste
1bdae3f9c4 Also check shell parameters for kak_* references
This makes it easier to pass shell fragments as arguments so that
%sh{ eval "$@" } just works even if arguments refer to Kakoune's
vars.
2024-06-07 18:59:30 +10:00
Maxime Coste
688e87d668 Add rc/filetype/perf.kak for perf-report highlight 2024-06-06 09:46:37 +10:00
Tobias Pisani
1c352e996c Add <quote> and <dquote> key name aliases.
These two can also be annoying to have to escape, so this should make it slightly easier to manage
2024-06-05 20:02:38 +10:00
Maxime Coste
51ec633718 Echo an information message about *scratch* buffer and leave it empty
Having to manually clear the scratch was never really nice and hopefully
this will be less annoying and as helpful to newcomers.
2024-06-05 19:49:35 +10:00
Maxime Coste
727d2391c7 Small regex code cleanup 2024-05-31 12:38:47 +10:00
Maxime Coste
5c97efacb9 Add v< and v> to scroll cursor to the leftmost/rightmost column 2024-05-31 12:38:28 +10:00
Maxime Coste
e6a70e621d Merge remote-tracking branch 'QiBaobin/git-completer' 2024-05-29 21:45:39 +10:00
Maxime Coste
83be9a03bc Merge remote-tracking branch 'dontlaugh/debug_mapping_output' 2024-05-29 21:44:07 +10:00
Maxime Coste
599a605f28 Merge remote-tracking branch 'dontlaugh/patch-1' 2024-05-29 21:41:50 +10:00
Maxime Coste
0aa6665154 Merge remote-tracking branch 'dontlaugh/patch-2' 2024-05-29 21:41:47 +10:00
Maxime Coste
3878c56f8d Merge remote-tracking branch 'm-kru/typst' 2024-05-29 21:39:24 +10:00
Michał Kruszewski
6d2b57d0ca tcl: Highlight variables as variables, not as values 2024-05-26 09:04:28 +02:00
Michał Kruszewski
6a853716c9 typst: Add typst.kak for typst markup highlighting 2024-05-23 15:01:26 +02:00
Coleman McFarland
2c1e238a0c
doc: declare C++20 as the language version
Technically we seem to be compiling with `-std=c++2a` which (if I
understand correctly) is "all the features we have from 23 and up.

But 20 is the earliest version that compiles for me (with clang). 14 and 17 didn't work.
2024-05-22 19:18:47 -04:00
Coleman McFarland
7818ea0cbb Add right hand side mapping to "debug mappings" 2024-05-22 18:45:54 -04:00
Coleman McFarland
52d264df27 doc: clarify that C and <a-C> act column-wise 2024-05-22 18:24:00 -04:00
Maxime Coste
1bd50261c8 Kakoune 2024.05.18 2024-05-18 14:43:06 +10:00
Johannes Altmanninger
7a90473267 Revert "Make TerminalUI::get_next_key() helpers static"
On macOS, backspace reportedly no longer works after <c-z> and fg.
The value of m_original_termios.c_cc[VERASE] seems to be wrong
in a static lambda that captures a singleton "this".
Not sure what's the problem. I thought that it is guaranteed that
"static auto convert = [this]() { ... }" is initialized lazily,
hence it should capture the correct address. Maybe the address
changes somehow or it's UB / a compiler bug.

This reverts commit ad36585b7a

Closes #5155
2024-05-18 11:35:48 +10:00
Chris Webb
4e5631daf3 Handle binary path detection errors on non-/proc platforms
On FreeBSD and NetBSD, sysctl() can return -1 when the path is too long,
leaving the buffer unitialised.

On macOS, both _NSGetExecutablePath() and realpath() can fail with
pathological paths or if memory is exhausted.

On Haiku, the kak_assert(status == B_OK) check will be compiled out in
non-debug builds.

Detect all of these cases and error out, reshaping get_kak_binary_path()
to avoid multiple repetitions of the same fatal error message.
2024-05-12 21:59:56 +10:00
Chris Webb
97a5d68adf Fix error handling when reading binary path from /proc
On Linux, Hurd, Cygwin, DragonFly BSD and Solaris/Illumos, Kakoune obtains
a path to its binary by reading the appropriate /proc symlink target.
readlink() can fail or it can fill the entire buffer, silently truncating
the path if the buffer is too small.

kak_assert() is compiled out in non-debug builds so we ignore a readlink()
failure, corrupt the stack by writing to buffer[-1] then return a string
from the uninitialised buffer.

If readlink() succeeds and the binary path is sizeof(buffer) long, we write
a \0 terminator beyond its end. If it is longer, we also truncate the path.

Throw a fatal error on startup in all these unlikely failure cases.
2024-05-12 21:59:52 +10:00
Maxime Coste
0e92b3fdef Fix another case where git tests were hanging 2024-05-12 14:18:17 +10:00
Maxime Coste
7be22f1ec2 Fix tests for OpenBSD
Using the diff provided by @krobelus on #5173

Close #5173
2024-05-12 11:14:17 +10:00
Maxime Coste
8c2775f665 Fix tests that were failing on alpine
Ensure perl exists for git blame tests, replace timing sensitive
`ui_out -ignore ...` with `ui_out -until '...'`
2024-05-10 12:07:45 +10:00