| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Move more code into the implementation files to reduce the amount
of code pulled by headers.
|
|
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.
|
|
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>.
|
|
These two can also be annoying to have to escape, so this should make it slightly easier to manage
|
|
Although Kakoune responds to modified mouse events, they show up in the
debug buffer corrupted. to_string() tests for equality on the mouse event
modifiers rather than testing just the relevant bits, so the modified
mouse events incorrectly fall through to the normal key handling.
Fix this and restructure to allow mouse events to be modifier-prefixed.
Signed-off-by: Chris Webb <chris@arachsys.com>
|
|
Analogous to the parent commit.
This returns StringView, but it's immortal so it's even better
than String.
|
|
This makes the function easier to find for newcomers because
to_string() is the obvious name. It enables format() to do the
conversion automatically which seems like good idea (since there is
no other obvious representation).
Of course this change makes it a bit harder to grep but that's not
a problem with clang tooling.
We need to cast the function in one place when calling transform()
but that's acceptable.
|
|
Terminals that support CSI u escape codes (like iTerm2, Kitty and foot)
allow us to map <s-space> independently of <space>.
Users expect that <s-space> inputs a space character; make it so.
Fixes #4534
Also reported in https://discuss.kakoune.com/t/shift-space-doesnt-send-space-character/2004
|
|
|
|
|
|
Previously, Kakoune only handled ctrl-codes less than 27, representing them as
lower-case ASCII codes. For regular keys like <c-a>, that worked fine. However,
NUL became the unorthodox <c-`> and other ctrl-symbols (<c-\>, <c-]>, <c-_>)
weren't supported at all.
Now NUL is rendered as the more comfortable <c-space>, and the other ctrl-symbol
codes are properly decoded.
Fixes #2553.
|
|
Change button to be an additional parameter instead of having separate
events for left/right buttons.
Fixes #3471
|
|
Similarly to the <semicolon> key, make it easier to write
`:execute-keys` commands by replacing <percent> with `%`.
Highlighters can keep escaping the sign when regular expressions are
not quoted, but built-in scripts that use `%` as an editing primitive
have been modified to use the named key, for clarity.
|
|
Fixes #3439
|
|
This commit allows using the <semicolon> expansion in commands, instead
of `\;`.
It makes commands look more elegant, and prevents new-comers from
falling into the trap of using <a-;> without escaping the semicolon.
|
|
|
|
The UI now can send a 'Scroll' key, whose value is the scrolling
amount encoded as a signed integer. This replaces the MouseWheelUp
and MouseWheelDown keys.
The NCursesUI now has a ncurses_wheel_scroll_amount ui_option that
controls that amount, it can be negative to swap scrolling direction.
Fixes #3045
|
|
|
|
The `parse_keys()` function is case insensitive when parsing function keys,
while the `key_to_str()` function always returns a capitalized key
description.
When users hook on the lowercase name of a function key,
e.g. `NormalKey <f10>`, and later hit that same key in normal mode, the
`key_to_str()` will convert it to the uppercase description ("<F10>").
This results into a hook with a lowercase regex predicate being unsuccessfully
matched against an uppercase key description by the hook manager, which
works on a case sensitive basis.
One solution could be to uppercase all function key descriptions passed as
hook filter upon declaration, but detecting that is not trivial as the
filter can contain more than just the simple <f\d+> data, e.g.
---
hook global InsertKey '<(?<name>\w+)>' %{…}
---
Another simpler solution that this commit implements is to allow only <F\d+>
descriptions in `parse_keys()`, and hope users will know not to use the
lowercase notation when declaring hooks.
Fixes #2907
|
|
The current implementation treats left mouse button clicks as a
generic "mouse press" modifier, this commit extends the list of
modifiers by adding a "right mouse click" one.
The proper way to implement this would be to ship the coordinates
of mouse key press events in each `Key` object, and pass whichever
button was clicked as a codepoint value (instead of coordinates
currently), but this would require more work.
This commit allows:
* right clicks to set the cursor of the main selection
* control-right clicks to merge all the selections, and then set
its cursor
Fixes #843
|
|
Because keyboard layouts vary, the shift-modifier `<s-…>` is only supported
for special keys (like `<up>` and `<home>`) and for ASCII lowercase where
we assume the shift-modifier just produces the matching uppercase character.
Even that's not universally true, since in Turkish `i` and `I` are not an
uppercase/lowercase pair, but Kakoune's default keyboard mappings already
assume en-US mappings for mnemonic purposes.
Mappings of the form `<s-x>` are normalized to `<X>` when `x` is an ASCII
character. `<backtab>` is removed, since we can now say `<s-tab>`.
|
|
|
|
|
|
|
|
|
|
|
|
Better fix for #1311
|
|
<ca-key> means control+alt key, <ac-key> works as well.
Fixes #1311
|
|
|
|
As requested in #960
|
|
Fixes #838
|
|
Add a ColumnCount type and use it in place of CharCount whenever
more appropriate, take column size of codepoints into account for
vertical movements and docstring wrapping.
Fixes #811
|
|
Fixes #722
|
|
As seen in #715, that was not supported correctly
|
|
|
|
|
|
require a proper unicode locale setup on the system
Fixes #94
|
|
utf8::iterator now knows the iterator valid range, and pass
it to utf8 functions.
|
|
Fixes #378
Fixes #365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|