1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-10-05 17:18:00 +03:00
Commit Graph

10594 Commits

Author SHA1 Message Date
Maxime Coste
6ed01f402b Reduce headers dependency graph
Move more code into the implementation files to reduce the amount
of code pulled by headers.
2024-08-12 20:02:11 +10:00
Maxime Coste
1b2100753e Reduce exposed headers from context.hh 2024-08-12 20:02:11 +10:00
Maxime Coste
1a52006c3d Extract format implementation to its own file
Split it to avoid pulling all string_utils dependencies for just
format.
2024-08-12 20:02:11 +10:00
Maxime Coste
2d9886afe7 Remove void_t and use requires instead 2024-08-12 20:02:11 +10:00
Maxime Coste
a250b96c18 Move most info/status clear logic to client
This makes it possible to remove the pending clears whenever an
info/status line is explicitely added, removing a class of race
conditions introduced by the previous implementation.
2024-08-12 17:10:12 +10:00
Eric
d15208fc19
Fixed highlighter marking everything as ruby string in ERB files 2024-08-09 09:33:56 -04:00
Maxime Coste
6af7a847c7 Delay NormalMode clearing of status line and info box to next idle
A common pattern is for info/echo messages to be generated by idle
hooks but the clearing of previous info/echo was done immediately on
normal mode events. This led to flickering of the info box especially
when a hook was repeatidly generating the same info (like moving
a cursor in the same word where the hook reacts to the word under
the cursor).
2024-08-08 13:08:01 +10:00
Thomas Teixeira
31e0c81156 Add gleam language support 2024-08-06 22:15:01 +10:00
Thomas Teixeira
3dcc042fb4 Thomas Teixeira 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.
--
2.45.2
2024-08-06 22:14:28 +10:00
Enrico Zandomeni Borba
0fddb3fef8 fix mouse scrolling 2024-08-06 09:03:38 +02:00
Johannes Altmanninger
ef18d3cbfb rc make/grep: evaluate makecmd in calling context, use eval semantics again
I configured :make to use a special makecmd for files called test.cpp.

	hook global BufCreate .*/test.cpp %{
		set-option buffer makecmd "g++ %val{buffile} && ./a.out"
	}

Commit c93cb5c4d (Add a `fifo` helper command and refactor `make`
and `grep` to use it, 2024-06-07) made :make evaluate makecmd in the
toolsclient context instead of the calling context, so my buffer-local
override no longer applies. I'm not sure if this is something we want
to guarantee but it doesn't seem unreasonable, and we can fix it a
no cost I think.

Additionally, it changed

    eval "${kak_opt_makecmd}" "$@";

to

    $kak_opt_makecmd "$@"

meaning that the "&&" in my makecmd will no longer be evaluated.
Instead it will be passed as argument to g++, effectively

    g++ %val{buffile} '&&' ./a.out

which I don't think is a reasonable expectation (unless we change
makecmd to be str-list options).  Essentially, the above only applies
word splitting to makecmd; it seems simpler and less surprising to
treat them as raw shell commands.

Expand makecmd in the calling client again, and insert it verbatim
into the shell script.

grep hasn't needed it so far but keep it consistent.
2024-08-05 19:14:48 +10:00
Enrico Zandomeni Borba
f2e7498ccc fix mouse coord underflow
previously, clicking on the status line if it is on the top of the
window results on a coord.line = 1 << 16, or there abouts. This is
because the expression

  (key & 0xFFFF0000) >> 16

results in an `shr` instruction which does not propagate the sign
bit. Mouse event coordinates can be negative if the status line is
on top and the status line is clicked. The new line

  (int32_t) (key & 0xFFFF0000) >> 16

properly propagates the sign bit, leading to the correct signed
numeric line coordinate.
2024-08-04 21:28:21 +02:00
Enrico Zandomeni Borba
e7605b4ec9 Enrico Zandomeni Borba
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-08-04 17:41:27 +02:00
Enrico Zandomeni Borba
7093f14291 add scroll coordinates
adds scroll amount in the upper 16-bits of `Key.modifiers`, reclaiming
the space in `Key.key` for coordinates. Previously, while mouse events
included their coordinates, scrolling did not. Scroll events are now
emitted as <scroll:amount:line.column>.
2024-08-04 17:40:29 +02:00
Adrià Arrufat
2ab35fbb23 Add support for double underline 2024-08-04 20:55:21 +09:00
Maxime Coste
8a5f449c18 Move most code in regex_impl inside the anonymous namespace
This is all internal code that should not be exposed.
2024-08-04 15:36:03 +10:00
Maxime Coste
10ed78fe8a Reduce templatization further to reduce binary size 2024-07-27 16:08:35 +10:00
Maxime Coste
128dafdfe9 Pass libs after object files to linker
Fixes #5206
2024-07-27 16:07:38 +10:00
Maxime Coste
46270444e4 De-templatize regex selection code
This led to lots of duplicated code gen, longer compile time, and
most likely unnoticeable performance difference
2024-07-24 22:00:34 +10:00
Maxime Coste
f8b3972375 Merge remote-tracking branch 'JustTaken/doc-review' 2024-07-24 21:28:53 +10:00
Maxime Coste
07674ac1a4 Merge remote-tracking branch 'JustTaken/view-offset' 2024-07-24 21:27:33 +10:00
JustTaken
02aa8debcb Review some buffer names in documentation
Now `\*debug*` and `\*scratch*` are used when refering these buffers
for prettier presentation.
2024-07-22 18:02:15 -04:00
JustTaken
ab7bfec047 Fix logic to get minimun custom offset
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.
2024-07-22 16:20:42 -04:00
Tobias Pisani
cb6f139786 Allow escaping commas in the -buffer argument to eval/exec
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.
2024-07-22 23:31:15 +10:00
Maxime Coste
e938d724f1 Handle word completion when recording macros
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.
2024-07-22 20:22:14 +10:00
JustTaken
cbe2997bb5 JustTaken 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-07-20 23:42:36 -04:00
JustTaken
38d4a75180 Take in account scrolloff when moving viewport
`vt` and `vb` respect custom scroll offset
2024-07-20 23:11:43 -04:00
Maxime Coste
6f562aa0ad Merge remote-tracking branch 'stacyharper/improve-php-heredoc' 2024-07-21 00:50:06 +10:00
Maxime Coste
7ef749965b De-templatize select_object
This removes lots of duplicated codegen at the expense of slightly
worse constant folding optimizations
2024-07-21 00:50:02 +10:00
Maxime Coste
a5ba9bb45f Disable UnitTest fully in non KAK_DEBUG builds
The code was still compiled and stored in the release executable,
this reduces the optimized binary size.
2024-07-21 00:50:02 +10:00
Maxime Coste
011283e4d2 Make sourcing gdb/kakoune.py automatically add the pretty printers
If pretty printers are not enabled, we can now just `source
gdb/kakoune.py` from gdb.
2024-07-19 13:07:31 +10:00
Maxime Coste
c971c42002 Record macros in repeat last insert
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.
2024-07-19 13:03:26 +10:00
Maxime Coste
8a109bd2f4 Bump history max size to 1000
100 was a bit small for long running sessions.
2024-07-18 09:52:27 +10:00
Willow Barraco
756a16769c
php: improve heredoc
Support nowdoc, and make ';' optional
2024-07-17 17:01:45 +02:00
Maxime Coste
fe8a03d158 Bump cirrus macos_gcc build to use g++-12 to fix crash on throw
It seems g++-10 running on rosetta on macos ventura triggers
generates some code that crashes in __cxa_throw, this seems
similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98805

We already have plenty of testing with gcc 10 so we can bump
macos gcc to workaround this.
2024-07-17 20:18:03 +10:00
Maxime Coste
12deb7d5da Clear info box and prompt on paste 2024-07-17 20:00:13 +10:00
Maxime Coste
e3ffa05ff0 Avoid doc renderer corner case in execeval page
The doc renderer is not expected to fully support asciidoc and can need
a bit of help by avoiding corner cases in pages

Closes #5198
2024-07-17 19:53:53 +10:00
Maxime Coste
840f4ec3ed Improve error message for alternations in lookarounds and add tests
Fixes #5203
2024-07-15 22:02:43 +10:00
Maxime Coste
c0013dcab2 Merge remote-tracking branch 'lobre/hooks-doc' 2024-07-15 20:43:22 +10:00
chelovechishko
f5220e25ba rc: filetype: sh.kak: add some more zsh files for auto coloring on open 2024-07-09 16:32:15 +09:00
chelovechishko
10b95895b6 chelovechishko 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-07-09 16:28:00 +09:00
Loric Brevet
caa3d93ea5
Remove whitespace in hooks documentation 2024-07-05 18:02:09 +02:00
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