| Age | Commit message (Collapse) | Author |
|
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>.
|
|
Errors when building with gcc 13:
ranked_match.hh:10:21: error: ‘uint64_t’ does not name a type
10 | using UsedLetters = uint64_t;
| ^~~~~~~~
|
|
|
|
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.
|
|
|
|
Use CTAD instead of make functions, requires instead of enable_if
|
|
|
|
Change button to be an additional parameter instead of having separate
events for left/right buttons.
Fixes #3471
|
|
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 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
|
|
By setting the ncurses_builtin_key_parser ui_option to true, we
can disable ncurses parsing of key strokes to get less portable
parsing but support for more complex modifiers.
|
|
Ideally, something better should be done (re #2554) but this is a decent
intermediate step for some useful keys.
Note: NCurses supports parsing these keys when shifted (KEY_SR,
_SLEFT, S_RIGHT, etc), but it does not do the same thing for the other
modifiers.
|
|
|
|
Window can be resized with an "offset_pos" flag, which means that
the resize took place on the top left corner of the window, leading
to a change in current window position. This is treated as temporary
and the position change is stored in a m_position_offset field.
That allows the ncurses UI to offset the position when it displays
a Search menu, so that the window does not constantly scroll when
the search menu open/closes. The window will only scroll if it needs
to in order to keep the main selectin visible.
|
|
the JsonUI now supports a "menu_select(int)" RPC call that should
trigger explicit selection of the provided item index.
As discussed for issue #2019.
|
|
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>`.
|
|
This hash map is now fully constexpr, and ends up stored in the read
only data segment instead of being recomputed at each startup.
|
|
|
|
|
|
This way we dont depend on knowing the base template to enable bit ops
on an enum type.
|
|
|
|
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
|
|
Fixes #383
|
|
Fixes #378
Fixes #365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::hash specialization is a pain to work with, stop using that, and
just specialize a 'size_t hash_value(const T&)' free function.
|
|
|
|
|
|
Fixes #145
Fixes #146
|
|
|
|
|
|
Fixes #18
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s/utf8::Codepoint/Codepoint/
|