Commit graph

3129 commits

Author SHA1 Message Date
Daniel Eklöf
d46dcd8ef5
render: ime: wip: pre-edit 2020-12-07 20:44:14 +01:00
Daniel Eklöf
fd42a0bc23
ime: call render_refresh_search() instead of render_refresh()
When scrollback search is active
2020-12-07 20:44:14 +01:00
Daniel Eklöf
194fbff883
ime: store wchar version of pre-edit string in terminal struct 2020-12-07 20:44:14 +01:00
Daniel Eklöf
7c420004fb
render: search: don’t access term->search.buf[] directly 2020-12-07 20:44:14 +01:00
Daniel Eklöf
1ea3674029
render: codespell: cound -> count 2020-12-07 20:44:13 +01:00
Daniel Eklöf
b4a0f5b13b
render: search: glyph_offset is in *cells*, cursor position in *characters*
When calculating the offset into the search string, from where to
start rendering, take into account that the cursor position is
in *characters*, and the glyph-offset is in *cells*.
2020-12-07 20:44:13 +01:00
Daniel Eklöf
5ffa65a2e3
render: search: wcsnlen() -> wcswidth() 2020-12-07 20:44:13 +01:00
Daniel Eklöf
a552610fdb
render: search: handle multi-column characters 2020-12-07 20:44:13 +01:00
Daniel Eklöf
dca35215d0
render: search: render colorized glyphs (emojis) correctly 2020-12-07 20:44:13 +01:00
Daniel Eklöf
d87160e5f6
ime: commit text using search_add_chars() while in scrollback search mode 2020-12-07 20:44:12 +01:00
Daniel Eklöf
f51ce34753
search: new function: search_add_chars()
This function inserts a string into the search buffer, at the current
insertion point (i.e. where the cursor is).
2020-12-07 20:44:12 +01:00
Daniel Eklöf
7eea6f94ed
ime: don’t commit to the slave while scrollback searching 2020-12-07 20:44:12 +01:00
Daniel Eklöf
9ce0edc8bb
render: ime: don’t render pre-edit string in grid while searching
While doing a scrollback search, the pre-edit string should be
rendered in the search box, not in the grid.

Note that we don’t yet support IME in scrollback search mode. This
patch simply prevents the pre-edit text being rendered in the grid,
in the “background”, while searching.
2020-12-07 20:44:12 +01:00
Daniel Eklöf
fe6cf547f1
install: highlight option default value in options list 2020-12-07 20:44:12 +01:00
Daniel Eklöf
ab699338b3
install: highlight option name in options list 2020-12-07 20:44:12 +01:00
Daniel Eklöf
725d17d21d
changelog: ime: add link to INSTALL.md 2020-12-07 20:44:12 +01:00
Daniel Eklöf
559c87b84a
install: add ‘options’ section, describing compile-time options 2020-12-07 20:44:12 +01:00
Daniel Eklöf
3df4ec1c8e
changelog: IME support 2020-12-07 20:44:12 +01:00
Daniel Eklöf
0536bc41f4
csi: add DECSET 737769 - enables/disables IME input
73 77 69 = I M E
2020-12-07 20:44:12 +01:00
Daniel Eklöf
e3b5a98ade
codespell: currenly -> currently, second instance 2020-12-07 20:44:11 +01:00
Daniel Eklöf
0fc2a1188c
codespell: currenly -> currently 2020-12-07 20:44:11 +01:00
Daniel Eklöf
77bc7c8b2c
features: include compile-time enable/disable state of features when printing version 2020-12-07 20:44:11 +01:00
Daniel Eklöf
2078e1675d
render: ime: draw a ‘bar’ cursor when the pre-edit cursor’s begin == end 2020-12-07 20:44:11 +01:00
Daniel Eklöf
85cdc66ff2
shm: fix badly indented function return type 2020-12-07 20:44:11 +01:00
Daniel Eklöf
b59d695b2b
ime: add functions to enable/disable IME, simplify code that enables IME
We may want to be able to enable/disable IME run-time, even though we
have received an ‘enter’ IME event.

This enables us to do that.

Also add functions to enable/disable IME on a per-terminal instance
basis.

A terminal may have multiple seats focusing it, and enabling/disabling
IME in a terminal instance enables/disables IME on all those seats.

Finally, the code to enable IME is simplified; the *only* surface that
can ever receive ‘enter’ IME events is the main grid. All other
surfaces are sub-surfaces, without their own keyboard focus.
2020-12-07 20:44:11 +01:00
Daniel Eklöf
5c17b7f8e7
ime: expand cursor cell-end across multi-cell characters
This fixes an issue where the cursor ended in the middle of e.g double
width characters.
2020-12-07 20:44:11 +01:00
Daniel Eklöf
001c82fa54
ime: don’t adjust cursor’s cell-end if it’s equal to the cell-begin 2020-12-07 20:44:11 +01:00
Daniel Eklöf
552b9884b9
ime: set cursor end correctly when it ends *after* the pre-edit string 2020-12-07 20:44:11 +01:00
Daniel Eklöf
cc76f91c43
ime: use correct index when calculating number of *cells* to advance 2020-12-07 20:44:11 +01:00
Daniel Eklöf
83d3ae10ae
render: ime: don’t render cursor if cursor begin == end 2020-12-07 20:44:10 +01:00
Daniel Eklöf
e9f99df2ab
render: ime: calculate on-screen cursor position ourselves
The position calculated by render_grid() may be -1,-1 if the cursor is
currently hidden.

This fixes a crash when trying to input IME while the cursor is
hidden.
2020-12-07 20:44:10 +01:00
Daniel Eklöf
98bd798dae
ime: calculate wchar widths once 2020-12-07 20:44:10 +01:00
Daniel Eklöf
4d90b200f1
render: ignore IME preedit state when deciding which cursor style to render 2020-12-07 20:44:10 +01:00
Daniel Eklöf
05083110c3
ime: make IME compile-time optional 2020-12-07 20:44:10 +01:00
Daniel Eklöf
8c3d48c5cd
ime: render pre-edit text
This is done by allocating cells for the pre-edit text when receiving
the text-input::done() call, and populating them by converting the
utf-8 formatted pre-edit text to wchars.

We also convert the pre-edit cursor position to cell positions (it can
cover multiple cells).

When rendering, we simply render the pre-edit cells on-top off the
regular grid. While doing so, we also mark the underlying, “real”,
cells as dirty, to ensure they are re-rendered when the pre-edit text
is modified or removed.
2020-12-07 20:44:10 +01:00
Daniel Eklöf
5745c610ac
ime: wip: commit all changes in ‘done()’ 2020-12-07 20:44:10 +01:00
Daniel Eklöf
b85e2f40bb
ime: feed committed string to client application 2020-12-07 20:44:10 +01:00
Daniel Eklöf
e97024116e
ime: disable text-input on surface leave 2020-12-07 20:44:10 +01:00
Daniel Eklöf
148bb1ff13
ime: wip: add text-input object to seat 2020-12-07 20:44:09 +01:00
Daniel Eklöf
d58d0601f6
changelog: DECSET 27127 - modifies Esc to send \E[27127~ instead of \E 2020-12-07 20:43:32 +01:00
Daniel Eklöf
cbda2fb9c1
Merge branch 'allow-key-collision-if-action-is-the-same'
Closes #233
2020-12-07 19:11:50 +01:00
Daniel Eklöf
5e46672cf4
config: ignore “self” when detecting key binding collisions
Previously, foot would not accept the following:

  [key-bindings]
  minimize=Escape
  minimize=Escape

Now it does. I.e. key combos in the action being updated are ignored
when detecting collisions.

The example above is contrived; a real world example could be to
remove certain combos from an action with multiple combos; perhaps to
free up a combo for another action. Example:

  [search-bindings]
  cancel=Escape

This would previously cause an error since `cancel=Control+g Escape`
by default.

Closes #233
2020-12-05 11:21:17 +01:00
Daniel Eklöf
a58557af30
changelog: remove ‘crash when pasting non-textual clipboard content’
This crash doesn’t not exist in any release versions.
2020-12-05 11:19:03 +01:00
Daniel Eklöf
384ba4d30d
fdm: do *not* keep polling on EINTR
This fixes an issue where foot --server did not exit on SIGINT. This
happened because we never returned out from fdm_poll(), and thus we
never saw ‘aborted’ being set.
2020-12-04 18:36:53 +01:00
Daniel Eklöf
c1c42f047e
Merge branch 'releases/1.5' 2020-12-01 20:02:58 +01:00
Daniel Eklöf
3156db74ec
meson/pkgbuild: bump version to 1.5.4 2020-12-01 19:52:36 +01:00
Daniel Eklöf
f6aa1495d7
input: relax requirements for overriding keypad application mode
Don’t require NumLock to be locked. Foot has no idea _which_ modifier
the user has mapped NumLock to, meaning we really cannot require it to
be locked.
2020-12-01 19:47:16 +01:00
Daniel Eklöf
9a33559fda
keymap: add ‘CSI 27;<mod>;27~’ escapes for Esc with modifiers 2020-12-01 19:46:14 +01:00
Daniel Eklöf
86de007311
doc: foot.5: minor highlighting fixes 2020-12-01 19:45:08 +01:00
Daniel Eklöf
54e4f8e407
doc: foot.1: no need to say foot.ini twice 2020-12-01 19:45:05 +01:00