| Age | Commit message (Collapse) | Author |
|
This led to lots of duplicated code gen, longer compile time, and
most likely unnoticeable performance difference
|
|
|
|
Now the scrolloff can be specified in the configuration file and
if either one of the column or line offset given is too large to
fit in the buffer, half of the window dimension is taken in it's
place. `v<` and `v>` account custom scroll offset as well.
|
|
I had this issue with device tree binding files in zephyr, that follow the vendor,device.yml
convention. The linux kernel presumably uses it as well.
While allowing escaping helps, we might consider using a separate option. The most obvious
approach might be to move the current behavior to -buffers, and have -buffer be
verbatim. However, I'm not entirely sure about the impact of that breakage,
so for now, at least the ability to escape it.
|
|
Make last insert and macro recording closer together, paving the
way towards moving last insert to a register.
Use a FunctionRef for insert completer key insertion support.
|
|
`vt` and `vb` respect custom scroll offset
|
|
This removes lots of duplicated codegen at the expense of slightly
worse constant folding optimizations
|
|
The code was still compiled and stored in the release executable,
this reduces the optimized binary size.
|
|
This fixes an issue with the following hooks:
hook global InsertCompletionShow .* %{ map window insert <tab> <c-n> }
hook global InsertCompletionHide .* %{ unmap window insert <tab> <c-n> }
When repeating a last insert using <tab> to select a completion, it
inserts a <tab> instead of selecting, then the insert completion tries
to erase the inserted text with backspaces but fails to totally do that
as it erases the tab character first.
|
|
100 was a bit small for long running sessions.
|
|
|
|
Fixes #5203
|
|
|
|
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.
|
|
This hook runs on `change-directory` and is also emitted just before
KakBegin after kakrc has been sourced.
|
|
Throwing early avoids losing selections in this case.
|
|
|
|
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.
|
|
|
|
The previous tradeoff of having a very small Thread struct is not
necessary anymore as we do not memcpy Threads on swap_next since
d708b77186c1685dcbd2298246ada7d204acec2f.
This requires offsets to be used instead of indices for jump/split
ops.
|
|
|
|
|
|
|
|
|
|
This makes it easier to pass shell fragments as arguments so that
%sh{ eval "$@" } just works even if arguments refer to Kakoune's
vars.
|
|
These two can also be annoying to have to escape, so this should make it slightly easier to manage
|
|
Having to manually clear the scratch was never really nice and hopefully
this will be less annoying and as helpful to newcomers.
|
|
|
|
|
|
|
|
|
|
|
|
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 ad36585b7ad236bea7d1c02b0679ae371c3c2a9e
Closes #5155
|
|
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.
|
|
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.
|
|
Using the diff provided by @krobelus on #5173
Close #5173
|
|
|
|
|
|
|
|
|
|
ASan shows that we resolve a face spec owned by a freed stack variable.
=================================================================
==2263300==ERROR: AddressSanitizer: stack-use-after-return on address 0x7a9316c33918 at pc 0x633ea421d8ea bp 0x7ffca001e980 sp 0x7ffca001e970
READ of size 8 at 0x7a9316c33918 thread T0
...
#6 0x633ea421d8e9 in Kakoune::FaceRegistry::resolve_spec(Kakoune::FaceSpec const&) const src/face_registry.cc:128
...
Address 0x7a9316c33918 is located in stack of thread T0 at offset 2328 in frame
#0 0x633ea427a095 in operator() src/commands.cc:2267
This frame has 26 object(s):
[32, 36) '<unknown>'
...
[544, 560) 'disable_hooks' (line 2269)
...
[928, 2432) 'local_scope' (line 2271) <== Memory access at offset 2328 is inside this variable
|
|
|
|
|
|
When using `eval` a new scope named 'local' gets pushed for the
whole evaluation, this makes it possible to temporarily set
an option/hook/alias...
Local scopes nest so nested evals do work as expected.
Remove the now trivial with-option command
|
|
Fail instead of silently doing nothing, this makes it easier to
toggle highlighters using a try/catch
|
|
This seems like a better overall behaviour.
Closes #5135
|
|
|
|
|
|
As @topisani pointed out in #5131, it is more user friendly to always
provide a %val{register} and %val{count} regardless of the mode.
|
|
This should implement what #5131 proposed in a different way.
Closes #5131
|