Hello community, here is the log from the commit of package kakoune for openSUSE:Factory checked in at 2020-09-03 01:16:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kakoune (Old) and /work/SRC/openSUSE:Factory/.kakoune.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kakoune" Thu Sep 3 01:16:16 2020 rev:17 rq:831368 version:2020.09.01 Changes: -------- --- /work/SRC/openSUSE:Factory/kakoune/kakoune.changes 2020-08-04 20:25:41.785048634 +0200 +++ /work/SRC/openSUSE:Factory/.kakoune.new.3399/kakoune.changes 2020-09-03 01:16:45.228527910 +0200 @@ -1,0 +2,7 @@ +Wed Sep 2 06:52:24 UTC 2020 - Michael Vetter <mvet...@suse.com> + +- Update to 2020.09.01: + * Daemon mode (-d switch) does not fork anymore. + * Fix crash on completion. + +------------------------------------------------------------------- Old: ---- kakoune-2020.08.04.tar.bz2 New: ---- kakoune-2020.09.01.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kakoune.spec ++++++ --- /var/tmp/diff_new_pack.HEf8WV/_old 2020-09-03 01:16:46.388528337 +0200 +++ /var/tmp/diff_new_pack.HEf8WV/_new 2020-09-03 01:16:46.392528339 +0200 @@ -17,7 +17,7 @@ Name: kakoune -Version: 2020.08.04 +Version: 2020.09.01 Release: 0 Summary: A code editor heavily inspired by Vim License: Unlicense ++++++ kakoune-2020.08.04.tar.bz2 -> kakoune-2020.09.01.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/README.asciidoc new/kakoune-2020.09.01/README.asciidoc --- old/kakoune-2020.08.04/README.asciidoc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/README.asciidoc 2020-09-01 12:37:20.000000000 +0200 @@ -207,6 +207,16 @@ ==== [TIP] +.Debian +==== +Kakoune can be found in Debian 9 (Stretch) and later releases. + +--------------------------- +sudo apt install kakoune +--------------------------- +==== + +[TIP] .FreeBSD ==== Kakoune is available in the official ports tree as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/colors/gruvbox.kak new/kakoune-2020.09.01/colors/gruvbox.kak --- old/kakoune-2020.08.04/colors/gruvbox.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/colors/gruvbox.kak 2020-09-01 12:37:20.000000000 +0200 @@ -11,13 +11,15 @@ orange="rgb:fe8019" bg="rgb:282828" + bg_alpha="rgba:282828a0" bg1="rgb:3c3836" bg2="rgb:504945" bg3="rgb:665c54" bg4="rgb:7c6f64" - fg0="rgb:fbf1c7" fg="rgb:ebdbb2" + fg_alpha="rgba:ebdbb2a0" + fg0="rgb:fbf1c7" fg2="rgb:d5c4a1" fg3="rgb:bdae93" fg4="rgb:a89984" @@ -48,8 +50,8 @@ face global list ${fg} face global Default ${fg},${bg} - face global PrimarySelection ${fg},${blue}+fg - face global SecondarySelection ${bg},${blue}+fg + face global PrimarySelection ${fg_alpha},${blue}+g + face global SecondarySelection ${bg_alpha},${blue}+g face global PrimaryCursor ${bg},${fg}+fg face global SecondaryCursor ${bg},${bg4}+fg face global PrimaryCursorEol ${bg},${fg4}+fg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/contrib/kakoune.spec new/kakoune-2020.09.01/contrib/kakoune.spec --- old/kakoune-2020.08.04/contrib/kakoune.spec 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/contrib/kakoune.spec 2020-09-01 12:37:20.000000000 +0200 @@ -5,7 +5,7 @@ %global build_ldflags %{build_ldflags} -flto Name: kakoune -Version: 2020.01.16 +Version: 2020.08.04 Release: 1%{?dist} Summary: Code editor heavily inspired by Vim @@ -83,6 +83,9 @@ %changelog +* Tue Aug 4 2020 Jiri Konecny <jkone...@redhat.com> - 2020.08.04-1 +- Update to 2020.08.04 + * Thu Jan 16 2020 Artem Polishchuk <ego.corda...@gmail.com> - 2020.01.16-1 - Update to 2020.01.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/doc/pages/changelog.asciidoc new/kakoune-2020.09.01/doc/pages/changelog.asciidoc --- old/kakoune-2020.08.04/doc/pages/changelog.asciidoc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/doc/pages/changelog.asciidoc 2020-09-01 12:37:20.000000000 +0200 @@ -3,6 +3,10 @@ This changelog contains major and/or breaking changes to Kakoune between released versions. +== Kakoune 2020.09.01 + +* Daemon mode (`-d` switch) does not fork anymore. + == Kakoune 2020.08.04 * Introduce `User` hook support. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/doc/pages/commands.asciidoc new/kakoune-2020.09.01/doc/pages/commands.asciidoc --- old/kakoune-2020.08.04/doc/pages/commands.asciidoc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/doc/pages/commands.asciidoc 2020-09-01 12:37:20.000000000 +0200 @@ -202,7 +202,7 @@ == Hooks *hook* [-group <group>] <scope> <hook_name> <filtering_regex> <command>:: - execute *command* whenever an *hook_name* is triggered in *scope* + execute *command* whenever a *hook_name* is triggered in *scope* (See <<hooks#,`:doc hooks`>> and <<scopes#,`:doc scopes`>>) *remove-hooks* <scope> <group>:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/doc/pages/expansions.asciidoc new/kakoune-2020.09.01/doc/pages/expansions.asciidoc --- old/kakoune-2020.08.04/doc/pages/expansions.asciidoc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/doc/pages/expansions.asciidoc 2020-09-01 12:37:20.000000000 +0200 @@ -306,8 +306,8 @@ current register when the mapping was triggered *%val{runtime}*:: - directory containing the kak support files, determined from Kakoune's - binary location + the directory containing the kak support files, which is determined from + Kakoune's binary location if `$KAKOUNE_RUNTIME` is not set *%val{select_mode}*:: _for commands executed from the object menu's `<a-;>` only_ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/doc/pages/faq.asciidoc new/kakoune-2020.09.01/doc/pages/faq.asciidoc --- old/kakoune-2020.08.04/doc/pages/faq.asciidoc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/doc/pages/faq.asciidoc 2020-09-01 12:37:20.000000000 +0200 @@ -1,44 +1,48 @@ = FAQ -== How to pronounce the name of the project and what does it mean ? +== The project + +=== How to pronounce the name of the project and what does it mean ? The name of the project is pronounced "Kak-oon", and is a word taken from a New Caledonian dialect based on French. It means a hard blow, usually a punch, -but generally refers to a blow into which all of one's strength went. +but generally refers to a strike into which all of one's strength went. + +=== Is there going to be a Windows port of Kakoune ? -== Is there going to be a Windows port of Kakoune ? +As many features provided by UNIX systems are missing or less efficient on +a Windows system, the incentive to porting the project to this operating +system is low. -As many features provided by UNIX systems would be missing, or if anything -much less efficient on a Windows system, the incentive to porting the -project to this operating system is pretty low. +Moreover, you can achieve pretty decent performance by using Kakoune on +Cygwin (which is officially supported). -Moreover, you can get pretty decent performance by using Kakoune on Cygwin -(which is officially supported). +== Interfacing -== Can I use Kakoune as a pager ? +=== Can I use Kakoune as a pager ? Kakoune can be used as a pager, either by setting the `PAGER` environment variable to `kak`, or by writing data directly to its standard input using a shell pipeline. -== Are there any non-console based frontends available ? +=== Are there any non-console based frontends available? No graphical frontend is currently officially maintained, you can however try experimental community-developed ones. -== Why are colors misrendered in my Kakoune clients ? +=== Why are colors misrendered in my Kakoune clients? -The most probable cause for that is a very widespread practice that consists -in setting the `TERM` environment variable in the shell's configuration file. -This variable should be set by the terminal emulator, and not overridden with -an arbitrary value, otherwise it might interfere with general UI rendering on -the terminal's window. +The most probable cause for colors being misrendered is a widespread practice +that consists in setting the `TERM` environment variable in the shell's +configuration file. This variable should be set by the terminal emulator, +and not overridden with an arbitrary value, otherwise it might interfere +with general UI rendering on the terminal's window. -== I'm using `tmux` and colors look weird +=== I'm using `tmux` and colors look weird If you're using a tool that doesn't support "palette switching", colors will still be slightly off: they are being rounded down to values supported by the -regular color palette by Kakoune. Fortunately, on recent versions of `tmux` +regular color palette of Kakoune. Fortunately, on recent versions of `tmux` (>=2.6), you can work around that by using the following configuration settings: @@ -59,14 +63,110 @@ Finally, quit all existing sessions (`tmux kill-server`), and restart `tmux`. -== Why does leaving insert mode take more than half a second in `tmux` ? +=== Why do I see weird special characters (~T~@~U) around Clippy? + +You need a UTF-8 compliant locale, in order to render special characters. + +The way to do so might vary from distribution to another, but an easy way +to verify that your locale is set correctly is to run the following command: + +---- +$ locale +---- + +The output should look similar to the following (with your own +language/country code set, instead of `en_US`): + +---- +LANG=en_US.UTF-8 +LC_CTYPE="en_US.UTF-8" +LC_NUMERIC="en_US.UTF-8" +LC_TIME="en_US.UTF-8" +LC_COLLATE="en_US.UTF-8" +LC_MONETARY="en_US.UTF-8" +LC_MESSAGES="en_US.UTF-8" +LC_PAPER="en_US.UTF-8" +LC_NAME="en_US.UTF-8" +LC_ADDRESS="en_US.UTF-8" +LC_TELEPHONE="en_US.UTF-8" +LC_MEASUREMENT="en_US.UTF-8" +LC_IDENTIFICATION="en_US.UTF-8" +LC_ALL= +---- + +You can also run the project's test suite, which should display errors if +your locale doesn't support UTF-8 rendering: + +---- +$ cd kakoune +$ make test +---- + +=== Why does leaving insert mode take more than half a second in `tmux`? Upon hitting the escape key, `tmux` waits for a short period of time to determine whether it's part of a function or a meta key sequence. In order to fix this "lag", set the waiting period in your `tmux` configuration file to a short time, e.g. 25ms: `set -sg escape-time 25` -== How do I automatically indent code, as Vim does with `=` ? +=== Can I split the window to display different buffers in them? + +As a fairly compliant follower of the UNIX philosophy, Kakoune does not +try to implement features that are best handled by separate, dedicated +tools. Window splitting in terminals is a prime example of that +concept, where the editor provides commands to interact with several +terminal multiplexers (e.g. `tmux`), as opposed to emulating their +functionalities. + +In order to open buffers in the same window simultaneously using `tmux` +(or one of the supported multiplexers), run Kakoune in a `tmux` session, +and simply use the `:new` command to spawn new clients as you would +have otherwise in an X11 environment. + +== Generic functionalities + +=== Something is wrong, how can I get more debug information? + +You can get quite a lot of information out of the editor at runtime. One +way is through the `:debug` command, which will print out statistics and +state data into the `\*debug*` buffer: + +---- +:debug <command> +---- + +Another way is to set flags on the `debug` option: + +---- +:set global debug <flags> +---- + +Make sure to read all possible values suggested by the completion engine, +as you type out both commands in a prompt. + +If you want to troubleshoot a crash, you need to compile the editor with +debug symbols enabled: + +---- +$ make debug=yes +---- + +The resulting binary should produce a stacktrace that you can, afterwards, +post in an issue in unmangled form (c.f. `c++filt`). + +=== How can I explore the filesystem the way Vim's NerdTree does? + +The builtin file completion engine used when opening a file for editing +(using the `:edit` command and letting the suggestions pop up in the menu +beneath) is more convenient than Vim's, which should suit basic needs. + +However, if you need an actual explorer to interact with the editor, +you can create a Kakoune script that will spawn the tool in question, +which should in return send an "edit" command followed by the path of the +file you selected to the current Kakoune session (e.g. `echo "eval -client +$kak_client edit /path/to/file" | kak -p $kak_session`). + +=== How do I automatically indent code, as Vim does with `=`? As `Kakoune` doesn't parse the contents of the buffers, there is no builtin equivalent for this Vim feature. Use a formatter/prettifier dedicated to @@ -74,10 +174,10 @@ Example: `%|indent<ret>` to indent an entire buffer with C code. -Note that some languages have a default formatter set, which you can use -with the `:format` command. +You can also set the `formatcmd` option and use the `:format` command to +format the entire buffer. -== Can Kakoune automatically complete the parameters of my functions ? +=== Can Kakoune automatically complete the parameters of my functions? As mentioned in the above question about Vim's `=` key, Kakoune does not parse the contents of a buffer by itself, which makes it impossible for @@ -88,10 +188,15 @@ `clang-enable-autocomplete` and `clang-complete` builtin commands whenever editing a C/C++ file, and completion will work on function parameters. -Note that the same features are available for Python buffers, with the -`jedi` script. +Other language-support scripts implement this functionality in a similar way, +for example the `jedi` script for Python buffers. -== Why aren't widely known command line shortcuts such as <c-w> or <c-u> available in Kakoune ? +Another way to get automatic parameter completion that doesn't depend on +built-in support in Kakoune is through the +https://microsoft.github.io/language-server-protocol/[Language Server Protocol], +for which you can find implementations that interact with the editor. + +=== Why aren't widely known command line shortcuts such as <c-w> or <c-u> available in Kakoune? Despite their widespread availability in multiple tools, those shortcuts do not fit the paradigm that Kakoune implements, which is based on selections @@ -101,68 +206,89 @@ to be able to use those control-based shortcuts in insert mode. (See <<mapping#,`:doc mapping`>>) -== How can I explore the filesystem the way Vim's NerdTree does ? +Also note that a subset of "readline shortcuts" is implemented for command +prompts. -The builtin file completion engine used when opening a file for editing -(using the `:edit` command and letting the suggestions popup in the menu -beneath) is much more convenient than Vim's, which should suit basic needs. - -However, if you need an actual explorer to interact with the editor, -you can create a Kakoune script that will spawn the tool in question, -which should in return send an "edit" command followed by the path of the -file you selected to the current Kakoune session (e.g. `echo "eval -client -$kak_client edit /path/to/file" | kak -p $kak_session`). - -== Why aren't there other scopes similar to `%sh{}` e.g. python ? - -Supporting custom scopes would add hard dependencies to the project, which -is too much of a drawback when balanced against the low cost of using -an interpreter in a regular shell scope (e.g. `%sh{ python -c "..." }`). -The shell scope allows users to spawn any interpreter they want, for a minimal -cost in terms of performance, it is therefore the reason why it's the only -one available by default. - -== What shell is used to expand `%sh{}` scopes ? - -The server expands shell scopes using the `sh` binary, stored in one of the -directories where all the POSIX standard utilities can be found -this list -of directories is stored in a system configuration variable, and queried -by Kakoune at startup. - -In most distributions, `/bin/sh` will end up being used. - -== Can I disable auto-indentation completely ? +=== Can I disable auto-indentation completely? All the indentation hooks are conventionally named `<lang>-indent`, which allows us to use the `disabled_hooks` variable to disable indentation globally with the following command: `set global disabled_hooks '.+-indent'` -== How to enable syntax highlighting ? +=== How to enable syntax highlighting? -The mimetype of the files opened in new buffers is detected using the +The MIME type of the files opened in new buffers is detected using the `file` command, and syntax highlighting enabled automatically when possible. -== My file seems to be highlighted with the wrong colors, I thought syntax highlighting was detected automatically ? +=== My file seems to be highlighted with the wrong colors, I thought syntax highlighting was detected automatically? The `file` utility has several shortcomings, such as detecting the -wrong mimetype for a file containing data with different syntax, e.g. +wrong MIME type for a file containing data with different syntax, e.g. a Python script containing hardcoded HTML templates detected as an HTML file. -Kakoune does its best at detecting file types (using known extensions -for a given format for instance), but not much can be done about those -ambiguous cases. You might consider writing a custom `$HOME/.magic` file -if needed. +Kakoune does its best to detect file types (using known extensions for a +given format for instance), but not much can be done about those ambiguous +cases. You might consider writing a custom `$HOME/.magic` file if needed. -== Can I disable syntax highlighting completely ? +=== Can I disable syntax highlighting completely? Similarly to the indentation hooks, the name format followed by the highlighting hooks is `<lang>-highlight`. You can thus disable syntax highlighting using the following command: `set global disabled_hooks '.+-highlight'` -== Why does a dot `.` in a regex select newline characters ? +=== Can the cursor be rendered as a beam? + +Rendering the cursor as a beam is a common feature of other modal editors, +it however doesn't fit within Kakoune's selection-first paradigm. + +There is a selection on screen at all times, containing either data selected +by the user, or a newline character when the buffer is empty. + +A selection is bound by an anchor and a cursor. They can overlap, but +ultimately must both be placed *over* a character. A beam cursor placed +*between* two characters doesn't fulfil that requirement, and is thus +not allowed. + +== The editing language + +=== The scripting language lacks keywords, when are you going to expand it? + +The scripting language is the smallest subset of statements/keywords that +allows users to write plugins, commands, mappings. + +It's not intended to be a one-stop generic interface, but rather a glue +between core Kakoune instructions and complex logic. + +Other editors generally come up with their own language or leverage existing +ones (for example, VimL, LUA), whereas Kakoune interacts with the shell, +through `%sh{…}` scopes. + +As arbitrary Kakoune data (options, selection etc.) can be shared with +shell scopes through environment variables, users are free to process this +data with pure shell scripting, or whatever interpreter they desire. + +=== Why aren't there other scopes similar to `%sh{}` e.g. python? + +Supporting custom scopes would add hard dependencies to the project, which +is too much of a drawback when balanced against the low cost of using +an interpreter in a regular shell scope (e.g. `%sh{ python -c "..." }`). +The shell scope allows users to spawn any interpreter they want, for a minimal +cost in terms of performance, it is therefore the reason why it's the only +one available by default. + +=== What shell is used to expand `%sh{}` scopes? + +The server expands shell scopes using the `sh` binary, located in one of +the directories containing all the POSIX standard utilities. This list of +directories is stored in a system configuration variable, and queried by +Kakoune at startup. + +In most distributions, `/bin/sh` will end up being used. + +=== Why does a dot `.` in a regex select newline characters? Data in buffers is a stream of characters, and newlines do not receive special treatment compared to other characters, with regards to regex matching. In @@ -170,21 +296,10 @@ use the `[^\n]+` pattern, which is arguably a good compromise when balanced against the ability to select data over several lines. -== Can I split the window to display different buffers in them ? +You can instruct the regex engine to stop matching newline characters with +`.` by disabling the appropriate flag (`(?S)`). -As a fairly compliant follower of the UNIX philosophy, Kakoune does not -try to implement features that are best handled by separate, dedicated -tools. Window splitting in terminals is a prime example of that -concept, where the editor provides commands to interact with several -terminal multiplexers (e.g. `tmux`), as opposed to emulating their -functionalities. - -In order to open buffers in the same window simultaneously using `tmux` -(or one of the supported multiplexers), run Kakoune in a `tmux` session, -and simply use the `:new` command to spawn new clients as you would -have otherwise in an X11 environment. - -== Why does `a` extend the current selection, but `i` leaves it untouched ? +=== Why does `a` extend the current selection, but `i` leaves it untouched? Selections are ranges of characters whose delimiters are an "anchor" and a "cursor", and inserting characters is always done before the cursor in @@ -195,3 +310,29 @@ the anchor remains immobile, even when the anchor and the cursor are at the same location. By opposition, using the insert primitive (`i`) merely adds characters before the cursor, which never modifies the current selection. + +=== How to apply changes to all open buffers? + +The `:exec` and `:eval` commands can apply changes to a comma-separated +list of buffers, passed as argument to the `-buffer` flag. + +In order to let the editor figure out which buffers are open, the special +value `*` is accepted as a wildcard. For example, in order to reload all +open buffers: + +---- +:eval -buffer * e! +---- + +=== Why is the text I pasted into a buffer completely mangled? + +In order to assist users with writing code, some buffers come with hooks that +automatically indent the text inserted. Pasting the contents of the clipboard +into a buffer in insert mode triggers this indentation functionality, +resulting into mangled text. + +To prevent that from happening: + +* disable hooks and enter insert mode with `\i` +* insert text into the buffer (e.g. paste the clipboard's contents) +* exit insert-mode, restoring hooks with `<esc>` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/doc/pages/keys.asciidoc new/kakoune-2020.09.01/doc/pages/keys.asciidoc --- old/kakoune-2020.08.04/doc/pages/keys.asciidoc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/doc/pages/keys.asciidoc 2020-09-01 12:37:20.000000000 +0200 @@ -95,7 +95,7 @@ == Movement 'word' is a sequence of alphanumeric characters or underscore, and 'WORD' -is a sequence of non whitespace characters. Generally, a movement on it own +is a sequence of non whitespace characters. Generally, a movement on its own will move each selection to cover the text moved over, while holding down the Shift modifier and moving will extend each selection instead. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/detection/modeline.kak new/kakoune-2020.09.01/rc/detection/modeline.kak --- old/kakoune-2020.08.04/rc/detection/modeline.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/detection/modeline.kak 2020-09-01 12:37:20.000000000 +0200 @@ -58,9 +58,8 @@ case "${kak_selection}" in *vi:*|*vim:*) type_selection="vim";; *kak:*|*kakoune:*) type_selection="kakoune";; - *) echo "echo -debug Unsupported modeline format";; + *) echo "echo -debug Unsupported modeline format"; exit 1 ;; esac - [ -n "${type_selection}" ] || exit 1 # The following subshell will keep the actual options of the modeline, and strip: # - the text that leads the first option, according to the official vim modeline format @@ -82,6 +81,7 @@ case "${type_selection}" in vim) tr=$(translate_opt_vim "${name_option}" "${value_option}");; kakoune) tr=$(translate_opt_kakoune "${name_option}" "${value_option}");; + *) tr="";; esac [ -n "${tr}" ] && printf %s\\n "${tr}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/dhall.kak new/kakoune-2020.09.01/rc/filetype/dhall.kak --- old/kakoune-2020.08.04/rc/filetype/dhall.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/dhall.kak 2020-09-01 12:37:20.000000000 +0200 @@ -89,7 +89,7 @@ # filter previous line try %{ execute-keys -draft k : dhall-trim-indent <ret> } # indent after lines ending with let, : or = - try %{ execute-keys -draft \; k x <a-k> (let|:|=)$ <ret> j <a-gt> } + try %{ execute-keys -draft \; k x <a-k> (\blet|:|=)$ <ret> j <a-gt> } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/elixir.kak new/kakoune-2020.09.01/rc/filetype/elixir.kak --- old/kakoune-2020.08.04/rc/filetype/elixir.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/elixir.kak 2020-09-01 12:37:20.000000000 +0200 @@ -52,7 +52,6 @@ } provide-module elixir %[ -require-module eex # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ @@ -99,11 +98,11 @@ # preserve previous line indent try %{ execute-keys -draft <semicolon> K <a-&> } # indent after line ending with: - # try %{ execute-keys -draft k x <a-k> (do|else|->)$ <ret> & } + # try %{ execute-keys -draft k x <a-k> (\bdo|\belse|->)$ <ret> & } # filter previous line try %{ execute-keys -draft k : elixir-trim-indent <ret> } # indent after lines ending with do or -> - try %{ execute-keys -draft <semicolon> k x <a-k> ^.+(do|->)$ <ret> j <a-gt> } + try %{ execute-keys -draft <semicolon> k x <a-k> ^.+(\bdo|->)$ <ret> j <a-gt> } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/elm.kak new/kakoune-2020.09.01/rc/filetype/elm.kak --- old/kakoune-2020.08.04/rc/filetype/elm.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/elm.kak 2020-09-01 12:37:20.000000000 +0200 @@ -58,7 +58,7 @@ } define-command -hidden elm-indent-after " - execute-keys -draft <semicolon> k x <a-k> ^\\h*(if)|(case\\h+[\\w']+\\h+of|let|in|\\{\\h+\\w+|\\w+\\h+->|[=(])$ <ret> j <a-gt> + execute-keys -draft <semicolon> k x <a-k> ^\\h*if|[=(]$|\\b(case\\h+[\\w']+\\h+of|let|in)$|(\\{\\h+\\w+|\\w+\\h+->)$ <ret> j <a-gt> " define-command -hidden elm-indent-on-new-line %{ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/fish.kak new/kakoune-2020.09.01/rc/filetype/fish.kak --- old/kakoune-2020.08.04/rc/filetype/fish.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/fish.kak 2020-09-01 12:37:20.000000000 +0200 @@ -43,7 +43,7 @@ add-highlighter shared/fish/code/ regex (\$\w+)|(\{\$\w+\}) 0:variable # Command names are collected using `builtin --names`. -add-highlighter shared/fish/code/ regex \b(and|argparse|begin|bg|bind|block|break|breakpoint|builtin|case|cd|command|commandline|complete|contains|continue|count|disown|echo|else|emit|end|eval|exec|exit|false|fg|for|function|functions|history|if|jobs|math|not|or|printf|pwd|random|read|realpath|return|set|set_color|source|status|switch|test|time|ulimit|wait|while)\b 0:keyword +add-highlighter shared/fish/code/ regex \b(and|argparse|begin|bg|bind|block|break|breakpoint|builtin|case|cd|command|commandline|complete|contains|continue|count|disown|echo|else|emit|end|eval|exec|exit|false|fg|for|function|functions|history|if|jobs|math|not|or|printf|pwd|random|read|realpath|return|set|set_color|source|status|string|switch|test|time|true|ulimit|wait|while)\b 0:keyword # Commands # ‾‾‾‾‾‾‾‾ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/fsharp.kak new/kakoune-2020.09.01/rc/filetype/fsharp.kak --- old/kakoune-2020.08.04/rc/filetype/fsharp.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/fsharp.kak 2020-09-01 12:37:20.000000000 +0200 @@ -135,7 +135,7 @@ # indent after line ending with = try %{ execute-keys -draft <space> k <a-x> <a-k> =$ <ret> j <a-gt> } # indent after line ending with "do" - try %{ execute-keys -draft <space> k <a-x> <a-k> do$ <ret> j <a-gt> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \bdo$ <ret> j <a-gt> } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/gluon.kak new/kakoune-2020.09.01/rc/filetype/gluon.kak --- old/kakoune-2020.08.04/rc/filetype/gluon.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/gluon.kak 2020-09-01 12:37:20.000000000 +0200 @@ -88,7 +88,7 @@ try %{ execute-keys -draft k : gluon-trim-indent <ret> } # indent after lines ending with (open) braces, =, ->, condition, rec, # or in - try %{ execute-keys -draft \; k x <a-k> (\(|\{|\[|=|->|then|else|rec|in)$ <ret> j <a-gt> } + try %{ execute-keys -draft \; k x <a-k> (\(|\{|\[|=|->|\b(?:then|else|rec|in))$ <ret> j <a-gt> } # deindent closing brace(s) when after cursor try %< execute-keys -draft <a-x> <a-k> ^\h*[})\]] <ret> gh / \})\]] <ret> m <a-S> 1<a-&> > _ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/haskell.kak new/kakoune-2020.09.01/rc/filetype/haskell.kak --- old/kakoune-2020.08.04/rc/filetype/haskell.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/haskell.kak 2020-09-01 12:37:20.000000000 +0200 @@ -114,7 +114,7 @@ # filter previous line try %{ execute-keys -draft k : haskell-trim-indent <ret> } # indent after lines beginning with condition or ending with expression or =( - try %{ execute-keys -draft <semicolon> k x <a-k> ^\h*(if)|(case\h+[\w']+\h+of|do|let|where|[=(])$ <ret> j <a-gt> } + try %{ execute-keys -draft <semicolon> k x <a-k> ^\h*if|[=(]$|\b(case\h+[\w']+\h+of|do|let|where)$ <ret> j <a-gt> } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/kakrc.kak new/kakoune-2020.09.01/rc/filetype/kakrc.kak --- old/kakoune-2020.08.04/rc/filetype/kakrc.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/kakrc.kak 2020-09-01 12:37:20.000000000 +0200 @@ -16,6 +16,7 @@ set-option window static_words %opt{kak_static_words} + hook window InsertChar \n -group kak-insert kak-insert-on-new-line hook window InsertChar \n -group kak-indent kak-indent-on-new-line hook window InsertChar [>)}\]] -group kak-indent kak-indent-on-closing-matching hook window InsertChar (?![[{(<>)}\]])[^\s\w] -group kak-indent kak-indent-on-closing-char @@ -56,7 +57,7 @@ # Grammar keywords="edit write write-all kill quit write-quit write-all-quit map unmap alias unalias buffer buffer-next buffer-previous delete-buffer add-highlighter remove-highlighter - hook remove-hooks define-command echo debug source try catch fail nop + hook trigger-user-hook remove-hooks define-command echo debug source try catch fail nop set-option unset-option update-option declare-option execute-keys evaluate-commands prompt menu on-key info set-face unset-face rename-client set-register select change-directory rename-session colorscheme declare-user-mode enter-user-mode @@ -90,10 +91,15 @@ # Commands # ‾‾‾‾‾‾‾‾ -define-command -hidden kak-indent-on-new-line %~ +define-command -hidden kak-insert-on-new-line %~ evaluate-commands -draft -itersel %= # copy '#' comment prefix and following white spaces try %{ execute-keys -draft k <a-x> s ^\h*#\h* <ret> y jgh P } + = +~ + +define-command -hidden kak-indent-on-new-line %~ + evaluate-commands -draft -itersel %= # preserve previous line indent try %{ execute-keys -draft <semicolon> K <a-&> } # cleanup trailing whitespaces from previous line diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/lua.kak new/kakoune-2020.09.01/rc/filetype/lua.kak --- old/kakoune-2020.08.04/rc/filetype/lua.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/lua.kak 2020-09-01 12:37:20.000000000 +0200 @@ -65,6 +65,8 @@ [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit ;; *.lua) + altfile="" + altdir="" path=$kak_buffile dirs=$(while [ $path ]; do printf %s\\n $path; path=${path%/*}; done | tail -n +2) for dir in $dirs; do @@ -74,7 +76,7 @@ break fi done - [ ! -d $altdir ] && echo "fail 'spec/ not found'" && exit + [ ! -d "$altdir" ] && echo "fail 'spec/ not found'" && exit ;; *) echo "fail 'alternative file not found'" && exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/markdown.kak new/kakoune-2020.09.01/rc/filetype/markdown.kak --- old/kakoune-2020.08.04/rc/filetype/markdown.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/markdown.kak 2020-09-01 12:37:20.000000000 +0200 @@ -79,7 +79,7 @@ add-highlighter shared/markdown/inline/text/ regex <(([a-z]+://.*?)|((mailto:)?[\w+-]+@[a-z]+[.][a-z]+))> 0:link add-highlighter shared/markdown/inline/text/ regex ^\[[^\]\n]*\]:\h*([^\n]*) 1:link add-highlighter shared/markdown/inline/text/ regex ^\h*(>\h*)+ 0:comment -add-highlighter shared/markdown/inline/text/ regex \H\K\h\h$ 0:PrimarySelection +add-highlighter shared/markdown/inline/text/ regex "\H( {2,})$" 1:+r@meta # Inline code add-highlighter shared/markdown/inline/text/ regex "^ [^\n]*" 0:meta diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/nim.kak new/kakoune-2020.09.01/rc/filetype/nim.kak --- old/kakoune-2020.08.04/rc/filetype/nim.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/nim.kak 2020-09-01 12:37:20.000000000 +0200 @@ -51,8 +51,8 @@ # Grammar opchars='[=+-/<>@$~&%|!?^.:\\*]' opnocol='[=+-/<>@$~&%|!?^.\\*]' - suffix="('[iIuU](8|16|32|64)|'[fF](32|64)?|'[dDuU]|[fF])?" - floatsuffix="('[fF](32|64)?|'[dD]|[fF])?" + suffix="('?([iIuU](8|16|32|64)|[fF](32|64)?|[dDuU]|[fF]))?" + floatsuffix="('?([fF](32|64)?|[dD]|[fF]))?" hexdigit='[0-9a-fA-F]' octdigit='[0-7]' bindigit='[01]' @@ -64,12 +64,12 @@ exponent="([eE][+-]?${declit})" floatlit="\b${declit}(\.${declit}${exponent}?|${exponent})${floatsuffix}\b" - keywords="addr as asm bind block break case cast concept const continue + keywords="addr asm bind block break case cast concept const continue converter defer discard distinct do elif else end enum except export - finally for from func if import include interface iterator let macro + finally for func if import include interface iterator let macro method mixin nil out proc ptr raise ref return static template try type unsafeAddr using var when while yield with without atomic generic" - operators="or xor and is isnot in notin of div mod shl shr not" + operators="or xor and is isnot in notin of div mod shl shr not as from" types="int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool char object seq array cstring string tuple varargs typedesc pointer byte set typed untyped void auto" @@ -117,7 +117,7 @@ # cleanup trailing whitespaces from previous line try %{ exec -draft k <a-x> s \h+$ <ret> d } # indent after line ending with enum, tuple, object, type, import, export, const, let, var, ':' or '=' - try %{ exec -draft <space> k <a-x> <a-k> (:|=|enum|tuple|object|const|let|var|import|export|type)$ <ret> j <a-gt> } + try %{ exec -draft <space> k <a-x> <a-k> (:|=|\b(?:enum|tuple|object|const|let|var|import|export|type))$ <ret> j <a-gt> } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/pony.kak new/kakoune-2020.09.01/rc/filetype/pony.kak --- old/kakoune-2020.08.04/rc/filetype/pony.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/pony.kak 2020-09-01 12:37:20.000000000 +0200 @@ -89,9 +89,9 @@ # copy '//' comment prefix and following white spaces # try %{ execute-keys -draft k x s ^\h*//\h* <ret> y jgh P } # indent after line ending with : - try %{ execute-keys -draft <space> k x <a-k> (do|try|then|else|:|=>)$ <ret> j <a-gt> } + try %{ execute-keys -draft <space> k x <a-k> (\b(?:do|try|then|else)|:|=>)$ <ret> j <a-gt> } # else, end are always de-indented - try %{ execute-keys -draft <space> k x <a-k> (else|end):$ <ret> k x s ^\h* <ret> y j x <a-k> ^<c-r>" <ret> J <a-lt> } + try %{ execute-keys -draft <space> k x <a-k> \b(else|end):$ <ret> k x s ^\h* <ret> y j x <a-k> ^<c-r>" <ret> J <a-lt> } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/python.kak new/kakoune-2020.09.01/rc/filetype/python.kak --- old/kakoune-2020.08.04/rc/filetype/python.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/python.kak 2020-09-01 12:37:20.000000000 +0200 @@ -136,8 +136,8 @@ " } -add-highlighter shared/python/code/ regex (?<=[\w\s\d\)\]'"_])(<=|<<|>>|>=|<>|<|>|!=|==|\||\^|&|\+|-|\*\*|\*|//?|%|~) 0:operator -add-highlighter shared/python/code/ regex (?<=[\w\s\d'"_])((?<![=<>!])=(?![=])|[+*-]=) 0:builtin +add-highlighter shared/python/code/ regex (?<=[\w\s\d\)\]'"_])(<=|<<|>>|>=|<>?|>|!=|==|\||\^|&|\+|-|\*\*?|//?|%|~) 0:operator +add-highlighter shared/python/code/ regex (?<=[\w\s\d'"_])((?<![=<>!]):?=(?![=])|[+*-]=) 0:builtin add-highlighter shared/python/code/ regex ^\h*(?:from|import)\h+(\S+) 1:module # Commands diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/ruby.kak new/kakoune-2020.09.01/rc/filetype/ruby.kak --- old/kakoune-2020.08.04/rc/filetype/ruby.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/ruby.kak 2020-09-01 12:37:20.000000000 +0200 @@ -120,6 +120,8 @@ [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit ;; *.rb) + altfile="" + altdir="" path=$kak_buffile dirs=$(while [ $path ]; do echo $path; path=${path%/*}; done | tail -n +2) for dir in $dirs; do @@ -130,7 +132,7 @@ break fi done - [ ! -d $altdir ] && echo "fail 'spec/ and test/ not found'" && exit + [ ! -d "$altdir" ] && echo "fail 'spec/ and test/ not found'" && exit ;; *) echo "fail 'alternative file not found'" && exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/filetype/sh.kak new/kakoune-2020.09.01/rc/filetype/sh.kak --- old/kakoune-2020.08.04/rc/filetype/sh.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/filetype/sh.kak 2020-09-01 12:37:20.000000000 +0200 @@ -7,6 +7,7 @@ set-option window static_words %opt{sh_static_words} hook window ModeChange pop:insert:.* -group sh-trim-indent sh-trim-indent + hook window InsertChar \n -group sh-insert sh-insert-on-new-line hook window InsertChar \n -group sh-indent sh-indent-on-new-line hook -once -always window WinSetOption filetype=.* %{ remove-hooks window sh-.+ } } @@ -22,7 +23,7 @@ add-highlighter shared/sh/code default-region group add-highlighter shared/sh/double_string region %{(?<!\\)(?:\\\\)*\K"} %{(?<!\\)(?:\\\\)*"} group add-highlighter shared/sh/single_string region %{(?<!\\)(?:\\\\)*\K'} %{'} fill string -add-highlighter shared/sh/expansion region '\$\{' '\}|\n' fill value +add-highlighter shared/sh/expansion region -recurse \$\{ \$\{ \}|\n fill value add-highlighter shared/sh/comment region (?<!\\)(?:\\\\)*(?:^|\h)\K# '$' fill comment add-highlighter shared/sh/heredoc region -match-capture '<<-?\h*''?(\w+)''?' '^\t*(\w+)$' fill string @@ -78,10 +79,15 @@ # Of necessity, this is also fairly opinionated about indentation styles. # Doing it "properly" would require far more context awareness than we can # bring to this kind of thing. -define-command -hidden sh-indent-on-new-line %[ +define-command -hidden sh-insert-on-new-line %[ evaluate-commands -draft -itersel %[ # copy '#' comment prefix and following white spaces try %{ execute-keys -draft k <a-x> s ^\h*\K#\h* <ret> y gh j P } + ] +] + +define-command -hidden sh-indent-on-new-line %[ + evaluate-commands -draft -itersel %[ # preserve previous line indent try %{ execute-keys -draft <semicolon> K <a-&> } # filter previous line @@ -106,9 +112,9 @@ # done # # indent after do - try %{ execute-keys -draft <space> k <a-x> <a-k> do$ <ret> j <a-gt> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \bdo$ <ret> j <a-gt> } # deindent after done - try %{ execute-keys -draft <space> k <a-x> <a-k> done$ <ret> K <a-&> j <a-lt> j K <a-&> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \bdone$ <ret> K <a-&> j <a-lt> j K <a-&> } # Indent if/then/else syntax, e.g.: # if [ $foo = $bar ]; then @@ -126,12 +132,12 @@ # fi # # indent after then - try %{ execute-keys -draft <space> k <a-x> <a-k> then$ <ret> j <a-gt> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \bthen$ <ret> j <a-gt> } # deindent after fi - try %{ execute-keys -draft <space> k <a-x> <a-k> fi$ <ret> K <a-&> j <a-lt> j K <a-&> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \bfi$ <ret> K <a-&> j <a-lt> j K <a-&> } # deindent and reindent after else - deindent the else, then back # down and return to the previous indent level. - try %{ execute-keys -draft <space> k <a-x> <a-k> else$ <ret> <a-lt> j } + try %{ execute-keys -draft <space> k <a-x> <a-k> \belse$ <ret> <a-lt> j } # Indent case syntax, e.g.: # case "$foo" in @@ -151,9 +157,9 @@ # esac # # indent after in - try %{ execute-keys -draft <space> k <a-x> <a-k> in$ <ret> j <a-gt> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \bin$ <ret> j <a-gt> } # deindent after esac - try %{ execute-keys -draft <space> k <a-x> <a-k> esac$ <ret> <a-lt> j K <a-&> } + try %{ execute-keys -draft <space> k <a-x> <a-k> \besac$ <ret> <a-lt> j K <a-&> } # indent after ) try %{ execute-keys -draft <space> k <a-x> <a-k> ^\s*\(?[^(]+[^)]\)$ <ret> j <a-gt> } # deindent after ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/autorestore.kak new/kakoune-2020.09.01/rc/tools/autorestore.kak --- old/kakoune-2020.08.04/rc/tools/autorestore.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/autorestore.kak 2020-09-01 12:37:20.000000000 +0200 @@ -9,11 +9,11 @@ if [ -f "${kak_buffile}" ]; then newer=$(find "${buffer_dirname}"/".${buffer_basename}.kak."* -newer "${kak_buffile}" -exec ls -1t {} + 2>/dev/null | head -n 1) - older=$(find "${buffer_dirname}"/".${buffer_basename}.kak."* \! -newer "${kak_buffile}" -exec ls -1t {} + 2>/dev/null | head -n 1) else # New buffers that were never written to disk. newer=$(ls -1t "${buffer_dirname}"/".${buffer_basename}.kak."* 2>/dev/null | head -n 1) + older="" fi if [ -z "${newer}" ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/clang.kak new/kakoune-2020.09.01/rc/tools/clang.kak --- old/kakoune-2020.08.04/rc/tools/clang.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/clang.kak 2020-09-01 12:37:20.000000000 +0200 @@ -173,6 +173,8 @@ evaluate-commands %sh{ eval "set -- ${kak_quoted_opt_clang_errors}" shift # skip timestamp + unset line + unset first_line for error in "$@"; do candidate=${error%%|*} first_line=${first_line-$candidate} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/doc.kak new/kakoune-2020.09.01/rc/tools/doc.kak --- old/kakoune-2020.08.04/rc/tools/doc.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/doc.kak 2020-09-01 12:37:20.000000000 +0200 @@ -14,6 +14,7 @@ evaluate-commands %sh{ face="$4" eval "set -- $kak_quoted_selections_desc" + ranges="" for desc in "$@"; do ranges="$ranges '$desc|$face'"; done echo "update-option buffer doc_render_ranges" echo "set-option -add buffer doc_render_ranges $ranges" @@ -154,6 +155,7 @@ evaluate-commands %sh{ readonly page="${kak_runtime}/doc/${1}.asciidoc" if [ -f "${page}" ]; then + jump_cmd="" if [ $# -eq 2 ]; then jump_cmd="doc-jump-to-anchor '$2'" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/git.kak new/kakoune-2020.09.01/rc/tools/git.kak --- old/kakoune-2020.08.04/rc/tools/git.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/git.kak 2020-09-01 12:37:20.000000000 +0200 @@ -229,6 +229,7 @@ fi done + wrapped=false if [ "$direction" = "next" ]; then if [ -z "$next_hunk" ]; then next_hunk=${hunks%% *} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/go/go-tools.kak new/kakoune-2020.09.01/rc/tools/go/go-tools.kak --- old/kakoune-2020.08.04/rc/tools/go/go-tools.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/go/go-tools.kak 2020-09-01 12:37:20.000000000 +0200 @@ -116,6 +116,7 @@ cat ${dir}/buf | wc -c >> ${dir}/modified cat ${dir}/buf >> ${dir}/modified + args="" if [ "$2" = "1" ]; then args="-json" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/grep.kak new/kakoune-2020.09.01/rc/tools/grep.kak --- old/kakoune-2020.08.04/rc/tools/grep.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/grep.kak 2020-09-01 12:37:20.000000000 +0200 @@ -53,13 +53,18 @@ define-command grep-next-match -docstring 'Jump to the next grep match' %{ evaluate-commands -try-client %opt{jumpclient} %{ buffer '*grep*' - # First jump to enf of buffer so that if grep_current_line == 0 + # First jump to end of buffer so that if grep_current_line == 0 # 0g<a-l> will be a no-op and we'll jump to the first result. # Yeah, thats ugly... execute-keys "ge %opt{grep_current_line}g<a-l> /^[^:]+:\d+:<ret>" grep-jump } - try %{ evaluate-commands -client %opt{toolsclient} %{ execute-keys gg %opt{grep_current_line}g } } + try %{ + evaluate-commands -client %opt{toolsclient} %{ + buffer '*grep*' + execute-keys gg %opt{grep_current_line}g + } + } } define-command grep-previous-match -docstring 'Jump to the previous grep match' %{ @@ -69,5 +74,10 @@ execute-keys "ge %opt{grep_current_line}g<a-h> <a-/>^[^:]+:\d+:<ret>" grep-jump } - try %{ evaluate-commands -client %opt{toolsclient} %{ execute-keys gg %opt{grep_current_line}g } } + try %{ + evaluate-commands -client %opt{toolsclient} %{ + buffer '*grep*' + execute-keys gg %opt{grep_current_line}g + } + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/man.kak new/kakoune-2020.09.01/rc/tools/man.kak --- old/kakoune-2020.08.04/rc/tools/man.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/man.kak 2020-09-01 12:37:20.000000000 +0200 @@ -74,6 +74,9 @@ pagenum="${pagenum%\)}" subject="${subject%%\(*}" ;; + *) + pagenum="" + ;; esac printf %s\\n "evaluate-commands -try-client %opt{docsclient} man-impl man $pagenum $subject" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/tools/spell.kak new/kakoune-2020.09.01/rc/tools/spell.kak --- old/kakoune-2020.08.04/rc/tools/spell.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/tools/spell.kak 2020-09-01 12:37:20.000000000 +0200 @@ -143,6 +143,7 @@ define-command \ -docstring "Suggest replacement words for the current selection, against the last language used by the spell-check command" \ spell-replace %{ evaluate-commands %sh{ + options="" if [ -n "$kak_opt_spell_last_lang" ]; then options="-l '$kak_opt_spell_last_lang'" fi @@ -159,6 +160,7 @@ define-command -params 0.. \ -docstring "Add the current selection to the dictionary" \ spell-add %{ evaluate-commands %sh{ + options="" if [ -n "$kak_opt_spell_last_lang" ]; then options="-l '$kak_opt_spell_last_lang'" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/rc/windowing/repl/tmux.kak new/kakoune-2020.09.01/rc/windowing/repl/tmux.kak --- old/kakoune-2020.08.04/rc/windowing/repl/tmux.kak 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/rc/windowing/repl/tmux.kak 2020-09-01 12:37:20.000000000 +0200 @@ -10,7 +10,7 @@ declare-option -docstring "tmux pane id in which the REPL is running" str tmux_repl_id -define-command -hidden -params 1..2 tmux-repl-impl %{ +define-command -hidden -params 1.. tmux-repl-impl %{ evaluate-commands %sh{ if [ -z "$TMUX" ]; then echo 'fail This command is only available in a tmux session' @@ -18,21 +18,20 @@ fi tmux_args="$1" shift - tmux_cmd="$@" - tmux $tmux_args $tmux_cmd + tmux $tmux_args "$@" printf "set-option global tmux_repl_id '%s'" $(tmux display-message -p '#{session_id}:#{window_id}.#{pane_id}') } } -define-command tmux-repl-vertical -params 0..1 -command-completion -docstring "Create a new vertical pane for repl interaction" %{ +define-command tmux-repl-vertical -params 0.. -command-completion -docstring "Create a new vertical pane for repl interaction" %{ tmux-repl-impl 'split-window -v' %arg{@} } -define-command tmux-repl-horizontal -params 0..1 -command-completion -docstring "Create a new horizontal pane for repl interaction" %{ +define-command tmux-repl-horizontal -params 0.. -command-completion -docstring "Create a new horizontal pane for repl interaction" %{ tmux-repl-impl 'split-window -h' %arg{@} } -define-command tmux-repl-window -params 0..1 -command-completion -docstring "Create a new window for repl interaction" %{ +define-command tmux-repl-window -params 0.. -command-completion -docstring "Create a new window for repl interaction" %{ tmux-repl-impl 'new-window' %arg{@} } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/share/kak/kakrc new/kakoune-2020.09.01/share/kak/kakrc --- old/kakoune-2020.08.04/share/kak/kakrc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/share/kak/kakrc 2020-09-01 12:37:20.000000000 +0200 @@ -11,6 +11,7 @@ find -L "${1}" -type f -name "${2}".kak | head -n 1 } + filename="" if [ -d "${kak_config}/colors" ]; then filename=$(find_colorscheme "${kak_config}/colors" "${1}") fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/.version new/kakoune-2020.09.01/src/.version --- old/kakoune-2020.08.04/src/.version 2020-08-04 11:41:46.000000000 +0200 +++ new/kakoune-2020.09.01/src/.version 2020-09-01 12:38:40.000000000 +0200 @@ -1 +1 @@ -v2020.08.04 +v2020.09.01 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/commands.cc new/kakoune-2020.09.01/src/commands.cc --- old/kakoune-2020.08.04/src/commands.cc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/src/commands.cc 2020-09-01 12:37:20.000000000 +0200 @@ -864,7 +864,7 @@ StringView scope{path.begin(), sep_it}; HighlighterGroup* root = nullptr; if (scope == "shared") - root = &DefinedHighlighters::instance(); + root = &SharedHighlighters::instance(); else if (auto* s = get_scope_ifp(scope, context)) root = &s->highlighters().group(); else @@ -889,7 +889,7 @@ auto sep_it = find(path, '/'); StringView scope{path.begin(), sep_it}; - auto* root = (scope == "shared") ? static_cast<HighlighterGroup*>(&DefinedHighlighters::instance()) + auto* root = (scope == "shared") ? static_cast<HighlighterGroup*>(&SharedHighlighters::instance()) : static_cast<HighlighterGroup*>(&get_scope(scope, context).highlighters().group()); if (sep_it != path.end()) return root->get_child(StringView{sep_it+1, path.end()}); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/face_registry.cc new/kakoune-2020.09.01/src/face_registry.cc --- old/kakoune-2020.08.04/src/face_registry.cc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/src/face_registry.cc 2020-09-01 12:37:20.000000000 +0200 @@ -76,8 +76,12 @@ }; auto filteredAttrs = attrs | - filter([=](const Attr& a) { return attributes & a.attr; }) | - transform([](const Attr& a) { return a.name; }); + filter([&](const Attr& a) { + if ((attributes & a.attr) != a.attr) + return false; + attributes &= ~a.attr; + return true; + }) | transform([](const Attr& a) { return a.name; }); return accumulate(filteredAttrs, "+"_str, std::plus<>{}); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/highlighter_group.hh new/kakoune-2020.09.01/src/highlighter_group.hh --- old/kakoune-2020.08.04/src/highlighter_group.hh 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/src/highlighter_group.hh 2020-09-01 12:37:20.000000000 +0200 @@ -57,10 +57,10 @@ HighlighterGroup m_group; }; -struct DefinedHighlighters : public HighlighterGroup, - public Singleton<DefinedHighlighters> +struct SharedHighlighters : public HighlighterGroup, + public Singleton<SharedHighlighters> { - DefinedHighlighters() : HighlighterGroup{HighlightPass::All} {} + SharedHighlighters() : HighlighterGroup{HighlightPass::All} {} }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/highlighters.cc new/kakoune-2020.09.01/src/highlighters.cc --- old/kakoune-2020.08.04/src/highlighters.cc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/src/highlighters.cc 2020-09-01 12:37:20.000000000 +0200 @@ -1695,7 +1695,7 @@ try { - DefinedHighlighters::instance().get_child(m_name).highlight(context, display_buffer, range); + SharedHighlighters::instance().get_child(m_name).highlight(context, display_buffer, range); } catch (child_not_found&) {} @@ -1705,7 +1705,7 @@ { try { - DefinedHighlighters::instance().get_child(m_name).compute_display_setup(context, setup); + SharedHighlighters::instance().get_child(m_name).compute_display_setup(context, setup); } catch (child_not_found&) {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/insert_completer.cc new/kakoune-2020.09.01/src/insert_completer.cc --- old/kakoune-2020.08.04/src/insert_completer.cc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/src/insert_completer.cc 2020-09-01 12:37:20.000000000 +0200 @@ -473,6 +473,7 @@ m_explicit_completer = nullptr; m_completions = InsertCompletion{}; + m_inserted_ranges.clear(); if (m_context.has_client()) { m_context.client().menu_hide(); @@ -563,6 +564,7 @@ auto& sels = m_context.selections(); try { + reset(); m_completions = complete_func(sels, m_options, m_faces); } catch (runtime_error& e) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kakoune-2020.08.04/src/main.cc new/kakoune-2020.09.01/src/main.cc --- old/kakoune-2020.08.04/src/main.cc 2020-08-04 11:40:43.000000000 +0200 +++ new/kakoune-2020.09.01/src/main.cc 2020-09-01 12:37:20.000000000 +0200 @@ -44,6 +44,9 @@ unsigned int version; StringView notes; } constexpr version_notes[] = { { + 20200901, + "» daemon mode does not fork anymore\n" + }, { 20200804, "» {+u}User{} hook support\n" "» Removed {+i}bold{} and {+i}italic{} faces from colorschemes\n" @@ -144,6 +147,9 @@ String runtime_directory() { + if (const char* runtime_directory = getenv("KAKOUNE_RUNTIME")) + return runtime_directory; + char relpath[PATH_MAX+1]; format_to(relpath, "{}../share/kak", split_path(get_kak_binary_path()).first); struct stat st; @@ -724,20 +730,10 @@ { static bool terminate = false; set_signal_handler(SIGTERM, [](int) { terminate = true; }); - if (flags & ServerFlags::Daemon) + if ((flags & ServerFlags::Daemon) and session.empty()) { - if (session.empty()) - { - write_stderr("-d needs a session name to be specified with -s\n"); - return -1; - } - if (pid_t child = fork()) - { - write_stderr(format("Kakoune forked to background, for session '{}'\n" - "send SIGTERM to process {} for closing the session\n", - session, child)); - exit(0); - } + write_stderr("-d needs a session name to be specified with -s\n"); + return -1; } EventManager event_manager; @@ -749,7 +745,7 @@ CommandManager command_manager; RegisterManager register_manager; HighlighterRegistry highlighter_registry; - DefinedHighlighters defined_highlighters; + SharedHighlighters defined_highlighters; ClientManager client_manager; BufferManager buffer_manager;