Add <c-w> and <a-d> (along with <c-W> and <a-D> that work on WORDs),
and <c-y> which pastes the transient clipboard contant (which saves
big erase, such as word erase and line end/begin erase).
Fixes#2355
In the end, no better solution materialized so far, and custom
Kakoune line editing bindings are hard to remember. Using well
known readline bindings seems just more convenient.
Closes#800, although it does not contain all the binding proposed
by it (I might accept a few additional ones, such as <c-w>, but not
too much, I still see that as a hack pending a nicer solution).
Previously, when wrapping lines at word boundaries, we would iterate forwards
for "wrap-width" characters, then iterate backwards until we found a word-break,
which was horribly slow.
Now we record the last word-boundary we saw as we iterate forwards, getting a
result in one pass.
Fixes#2339.
Due to a copy-paste mistake, the `:kill` command in a session with
multiple clients was the equivalent of a force-kill (`:kill!`).
This commit makes sure all buffers are saved before killing the
session, unless the force flag is specified.
Cast errors in RPC requests currently make the client quit with an
error saying "uncaught exception", since `Kakoune::bad_value_cast`
exceptions are not explicitely handled.
This commit tries to catch ill-formatted requests and return a more
human-friendly error message, without quitting the client.
This commit implements the -once flag on the `:hook` command, which
automatically removes a hook after it was run, to avoid having to
declare a group and remove it in the hook implementation.
Closes#2277
In particular, this make gathering a transformed range to a vector
faster because we can use the random access nature of underlying
iterator to get the size to allocate in the vector upfront.
Creating a window potentially runs hooks, which themselves could
trigger shell evaluation, which could handle urgent input events
such as a resize, while waiting for the shell to finish. When that
happens, the client had a temporarily null window as it had already
released its own window.
Fixes#2225