Commit Graph

9505 Commits

Author SHA1 Message Date
Maxime Coste
adbb7b8118 Merge remote-tracking branch 'krobelus/sway-focused_tab_title' 2022-04-11 19:53:20 +10:00
Maxime Coste
9d66c97fba Merge remote-tracking branch 'krobelus/fix-doc-links' 2022-04-11 19:53:05 +10:00
Maxime Coste
7d1989d48b Merge remote-tracking branch 'krobelus/black-on-white-colorscheme' 2022-04-11 19:52:41 +10:00
Maxime Coste
5b7f112fdc Merge remote-tracking branch 'krobelus/format-show-error-in-client' 2022-04-11 19:52:15 +10:00
Maxime Coste
0ddad3c030 Merge remote-tracking branch 'Screwtapello/cleanup-session-name-validation' 2022-04-11 19:50:54 +10:00
Maxime Coste
e40ff99eae Code style cleanups around object selection code 2022-04-11 19:49:36 +10:00
Johannes Altmanninger
f0122f10df Add black-on-white colorscheme
Kakoune doesn't have an equivalent of Vim's ":syntax off". This
colorscheme is as close as it gets: it uses various shades of grey
for cursors, selections and completion/info boxes, and black/white for
everything else.  The high-contrast makes it ideal for bright settings.

I also have the dual white-on-black colorscheme but it's not tested
much, so I left it on my "colorschemes" branch.
2022-04-09 15:38:04 +02:00
Johannes Altmanninger
a0477b1016 rc format: restore in-client error when formatcmd fails
Commit 5b1f9255 (rc: Use the standard `fail` command to report errors,
2019-11-14) replaced uses of "echo -markup {Error}" with "fail".
This made format-buffer do

	echo "eval -client $kak_client %{ fail }" | kak -p $kak_session

Unfortunately "fail" fails in the client spawned by "kak -p" and not
in $kak_client where the user would see the message. Correct this.

While at it, clarify the error message, so users immediately know
that the number is the exit code.

Fixes #3254
2022-04-09 15:36:02 +02:00
Johannes Altmanninger
019a73f4b9 rc i3: highlight sway's focused_tab_title option
Not sure if this should support sway-specific extensions but it doesn't hurt.
2022-04-09 15:29:54 +02:00
Johannes Altmanninger
7c43a4b51b doc: fix dead links to doc pages 2022-04-09 15:29:54 +02:00
Tim Allen
9cf8a3ccd6 Check for buffer overflow when constructing the socket path. 2022-04-07 21:36:15 +10:00
Tim Allen
9e6b678cf7 Do all session name validation in session_path(). 2022-04-07 21:23:10 +10:00
Maxime Coste
eae8ea8a54 Merge remote-tracking branch 'krobelus/ini-hash-comments' 2022-03-21 21:04:55 +11:00
Maxime Coste
3667f8bb21 Merge branch 'master' of http://github.com/eko234/kakoune 2022-03-21 20:55:12 +11:00
Maxime Coste
bde59926be Merge remote-tracking branch 'tomKPZ/fix-buffer-overflow' 2022-03-21 20:52:07 +11:00
Maxime Coste
243a2abf45 Merge remote-tracking branch 'hugomg/hugomg-ubuntu-g++-10' 2022-03-21 20:50:09 +11:00
Maxime Coste
5e7afdcd04 Merge remote-tracking branch 'CharlesGueunet/FixCMakeComment' 2022-03-21 20:49:42 +11:00
Hugo Musso Gualandi
73f0de4085 Improved installation instructions for Ubuntu
Added information on how to install from the repositories. Improved the instructions for how to build from source, for those that don't want an ancient version of Kakoune. On Ubuntu 20.04 and earlier, GCC 10 is not the default so we have to explicitly tell `make` to use GCC 10.

See also: https://github.com/mawww/kakoune/issues/4571
2022-03-20 16:22:27 +01:00
Charles Gueunet
11c9984f26 Charles Gueunet 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.
2022-03-18 09:01:04 +01:00
Charles Gueunet
2f1cb11194 CMake: fix comment highlight 2022-03-18 09:01:02 +01:00
Maxime Coste
13b1681593 Merge remote-tracking branch 'krobelus/doc-complete-command-args' 2022-03-15 20:24:00 +11:00
Johannes Altmanninger
0f0f2b126d doc commands: fix names of complete-command's completion_type arguments 2022-03-08 22:10:28 +01:00
Johannes Altmanninger
13948ecb94 rc diff: pass diff to diff-jump via stdin instead of env
Passing large diff buffers via the environment can quickly result in
the error "execve failed: Argument list too long". Use a pipe like
in format.kak

When running | (or <a-|>), Kakoune does not use %arg{@} to populate
"$@" (missing feature?). Work around this by moving %arg{@} to a
temporary register. Apparently $kak_quoted_reg_a will never be an
empty list, so work around that too.

When diff parsing fails, we take care to run "fail" in the calling
client, unlike :format (probably a bug in format.kak).

(This patch is best viewed while ignoring whitespace changes (diff -w))
2022-03-08 20:30:06 +01:00
tomKPZ
f709ba6390 Fix buffer overflow in parse_quoted
This fixes a crash when using kak-lsp with bash-language-server.  The
issue is that the second read() in parse_quoted may read past the end of
the string.  If this happens and the condition on line 126 is false,
then the loop on line 119 will continue to read past the end of the
buffer since it checks for state.pos != end instead of state.pos < end,
which will likely result in a crash.  The fix is to add a check for the
buffer end before the second read. The added test fails without the
change and passes with the change.
2022-03-08 09:05:10 -08:00
tomKPZ
82db91c58c Thomas Anderson 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.
2022-03-08 09:04:41 -08:00
Johannes Altmanninger
eaaf562ed1 rc diff: support absolute paths in diff-jump
Quick repro:

	diff /dev/null $PWD/README.asciidoc -u | kak -e 'set-option buffer filetype diff'

Fixes #4531
2022-03-06 09:49:55 +01:00
Johannes Altmanninger
49de2b91c4 rc diff: bind diff-jump in all filetype=diff buffers, not just *.diff or *.patch files
Mapping in the filetype hook matches others like grep.kak and man.kak.
Since we map in buffer scope, git diff buffers will override diff-jump
with git-diff-goto-source.

This means that the diff-jump binding applies here:

	diff -u "$1" "$2" | kak -e 'set buffer filetype diff'

Reported in: https://github.com/mawww/kakoune/issues/153#issuecomment-1030643854
2022-03-06 09:49:55 +01:00
Johannes Altmanninger
1c2e1e1090 rc diff: fix style
This line was unindented by accident (I was rushing..)
2022-03-06 09:49:55 +01:00
Maxime Coste
1d6476d329 Document the GCC >= 10.3 instead of just >= 10 requirement 2022-03-06 10:13:14 +11:00
Maxime Coste
d95d351cbe Document ! and <a-!> breaking change 2022-03-06 10:13:14 +11:00
Frank LENORMAND
85b78dda2e src: Select the data inserted by ! and <a-!>
Closes #1468
2022-03-06 10:13:14 +11:00
Maxime Coste
7061001728 Add a complete-command command to configure command completion
This makes it possible to change command completion in hooks and
paves the way to more flexibility in how custom commands can be
completed
2022-03-06 10:13:14 +11:00
Maxime Coste
b915e4e11b Close MappedFile fd using on_scope_end to handle all return paths 2022-03-06 10:13:14 +11:00
Luis Alfonso Buelvas Betancourt
d6392e37c9
fennel filetype now highlights accumulate keyword 2022-02-22 17:13:38 -05:00
Maxime Coste
30c05e83f8 Remove unnecessary workaround in Buffer::insert 2022-02-22 08:28:33 +11:00
Maxime Coste
3f856d4e30 Merge remote-tracking branch 'SolitudeSF/elvish' 2022-02-22 08:12:15 +11:00
Johannes Altmanninger
3a856ef57b rc conf: treat ini files as conf if they contain a #-comment
*.ini files traditionally use ; but for example the "foot" terminal's
foot.ini uses #. Add a hack to treat ini files as "conf" filetype
if they contain a #-comment (very slim chance of false positives).
This requires to explicitly set comment_line to the default #,
because we set the "ini" filetype earlier.
2022-02-19 17:31:55 +01:00
Johannes Altmanninger
cc6fe5ae61 Add conf filetype, for generic Unix configuration files
We set the "ini" filetype for files ending in one of "repo", "ini",
"cfg", "properties" or "desktop".  Most of these actually use Unix
style comments (#) instead of DOS INI comments (;).

Introduce filetype "conf" which is similar to "ini" except it uses the
default # as comment_line string.  Both Vim and Emacs have a filetype
(or Major mode) named "conf" (hence modeline-parse of "vim ft=conf"
will work).

Here are references that show that the new "conf" files use #-comments:
*.repo -- search for # in
    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-configuring_yum_and_yum_repositories
*.cfg: don't know much about this one, but at least the motivating file uses #
    https://github.com/buildout/buildout/blob/master/buildout.cfg
*.properties files:
    https://en.wikipedia.org/wiki/.properties
*.desktop: per spec
    https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s03.html#comments
2022-02-19 17:31:16 +01:00
SolitudeSF
1dc0a2eaf2
Fix elvish highlighter 2022-02-18 18:19:21 +02:00
Maxime Coste
0e572589f3 Do not keep MappedFile fd opened
According to the mmap man page this is not necessary, and this avoids
exposing the fd.
2022-02-18 20:24:23 +11:00
Maxime Coste
e04a14cf73 Merge branch 'patch-1' of http://github.com/Rosuavio/kakoune 2022-02-16 07:55:56 +11:00
Maxime Coste
a52b867dba Merge remote-tracking branch 'dontlaugh/patch-1' 2022-02-15 21:01:50 +11:00
Maxime Coste
0d1136474f Merge remote-tracking branch 'xiaq/master' 2022-02-15 20:56:21 +11:00
Maxime Coste
f150bbd54a Merge remote-tracking branch 'm-kru/vhdl_end_protected_body' 2022-02-15 20:51:45 +11:00
Maxime Coste
ffb02222c3 Merge remote-tracking branch 'krobelus/c-n-autocomplete' 2022-02-15 20:51:11 +11:00
Maxime Coste
17237fb887 Merge remote-tracking branch 'krobelus/different-select-cmd-no-dupe' 2022-02-15 20:46:38 +11:00
Maxime Coste
b6a9fd6e3a Merge remote-tracking branch 'c7skasku/fix-c-comments-whitespace' 2022-02-15 20:45:40 +11:00
Maxime Coste
d3f9358fdb Merge remote-tracking branch 'Qeole/pr/crash-colors' 2022-02-15 20:44:41 +11:00
Maxime Coste
b030fc4c07 Merge remote-tracking branch 'Screwtapello/validate_alpha-is-constexpr' 2022-02-15 20:43:43 +11:00
Coleman McFarland
0b5ed7613f Update module description in response to code review 2022-02-14 10:20:10 -05:00