Commit graph

5471 commits

Author SHA1 Message Date
Daniel Eklöf
8c0fca30db
selection: find_word_boundary: assert ‘pos’ is valid 2022-04-24 20:17:29 +02:00
Daniel Eklöf
47d1ba58e5
changelog: UI not refreshing when pasting into the scrollback search box 2022-04-24 12:08:23 +02:00
Daniel Eklöf
2cbcfb3159
render: fix refresh logic of pending csd|search|url
Our CSDs, the search-box and URL labels are all implemented using
sub-surfaces, synchronized with the main grid.

This means we *must* commit the main surface as well, when updating
one of these sub-surfaces.

The logic for doing so in the frame callback was flawed, and only
triggered when the main grid was actually dirty.

That is, e.g. search box updates that did not also resulted in grid
updates (for example - pasting a search criteria that doesn’t match),
did not result in a UI refresh.

Closes #1040
2022-04-24 12:04:06 +02:00
Daniel Eklöf
b68d5da71b
search: fix debug log
This has been broken since the forward/backward search logic was
refactored.
2022-04-24 12:03:31 +02:00
Daniel Eklöf
f0f0fac77f
doc: foot.ini: drop empty line after *show-urls-launch* 2022-04-23 20:08:09 +02:00
Daniel Eklöf
155a2e4790
ci: enable -Db_pgo=generate on release builds
Hopefully, this’ll catch missing stubs in pgo/pgo.c in the future.
2022-04-23 11:24:44 +02:00
Daniel Eklöf
1913fb6efd
changelog: hyperlink lists under their corresponding sub-section 2022-04-23 11:13:25 +02:00
Daniel Eklöf
4ca0407945
raedme: add a reference to foot-ctlseq(7) 2022-04-23 11:11:34 +02:00
Daniel Eklöf
ce4fd6df3f
readme: add OSC 22 2022-04-23 11:10:37 +02:00
Daniel Eklöf
ae2999740e
readme: default foot.ini is now installed to /etc/xdg/foot/foot.ini 2022-04-23 11:10:09 +02:00
Daniel Eklöf
9483a3a7c0
changelog: pgo helper binary build fix (missing key-binding stubs) 2022-04-23 00:49:52 +02:00
Daniel Eklöf
8ceb6e45a4
pgo: add missing stubs for key-binding functions
* key_binding_new_for_term()
* key_binding_unref_term()
2022-04-23 00:44:46 +02:00
Daniel Eklöf
1383def2a0
changelog: convert all issue links to reference links in the 1.12.0 release 2022-04-22 20:05:33 +02:00
Daniel Eklöf
61446df895
Revert "changelog: convert all issue links to reference links in the 1.12.0 release"
This reverts commit 6652a836ad.

We only added the actual links to the 1.12.0 release, meaning all
other issue hyperlinks broke.
2022-04-22 20:02:15 +02:00
Daniel Eklöf
6652a836ad
changelog: convert all issue links to reference links in the 1.12.0 release 2022-04-22 18:54:49 +02:00
Daniel Eklöf
e284c764b7
changelog: replace all bug refs with markdown hyperlinks 2022-04-22 18:36:28 +02:00
Daniel Eklöf
2d4d919687
changelog: add new ‘unreleased’ section 2022-04-22 17:19:04 +02:00
Daniel Eklöf
d8c4e21090
Merge branch 'releases/1.12' 2022-04-22 17:18:26 +02:00
Daniel Eklöf
ea1171a5a2
meson: bump version to 1.12.0 2022-04-22 17:14:41 +02:00
Daniel Eklöf
0cdd32043e
changelog: prepare for 1.12.0 2022-04-22 17:14:00 +02:00
Daniel Eklöf
c7248cf763
meson: add -Dtests=false|true option
When set to false, no test binaries are neither built, nor
executed (with “ninja test”).

Closes #919
2022-04-22 17:05:25 +02:00
Merlin Büge
e6f884a9e1
doc + meson.build: update information about foot.ini, small cleanup
- foot.ini.5: mention location of example config file
- foot.1: replace outdated (or incomplete) information about the
  location of the config file with references to foot.ini.5
- foot.1 and foot.ini.5: conform to scdoc specification, thus surround each
  header with (at least) one blank line. additionally consistently use exactly
  one line before/after each header (was sometimes two before)
- foot.1: some parts of the keybindings had their own section, move into
  KEYBOARD SHORTCUTS section
- foot.1: move EXIT STATUS section to the end where it is commonly found
- foot.1: copy information about config file handling from the beginning of
  foot.ini.5 into the CONFIGURATION section of foot.1
- INSTALL.md: foot.ini is no longer included in the documentation
- meson.build: do not bundle foot.ini with documentation anymore, see also
  https://codeberg.org/dnkl/foot/pulls/1015

Closes #1002
2022-04-22 17:00:04 +02:00
Daniel Eklöf
9907d7bbe9
search: don't modify search.start coord *before* finding next match
The match logic uses the last start coordinate to determine which end
points in the selection to update. This sometimes fails when the start
coordinate has been changed by e.g. a key binding - the new start
coordinate is incorrectly matched against the old-but-modified start
coordinate, causing foot to e.g. *not* upate the selection start
coordinate.

Example:

  $ echo 'test\n\test\ntest'

Then do a scrollback search for 'test. The first match is found
correctly (the last 'test'), but searching for the previous match
(ctrl+r) does not select the middle 'test'.

Fix by passing the search direction to search_find_next(), and have
_it_ calculate the coordinate to start search. There are three possibilities:

* forward
* backward
* "backward", but at the same position

The first two are used when searching for next/prev match with ctrl+s
and ctrl+r. The last one is used when the search criteria is
updated. In this case, we don't want to move to the previous match,
*unless* the current match no longer matches.
2022-04-21 18:54:27 +02:00
Daniel Eklöf
dd03e10c6c
url-mode: allow locked modifiers while handling label letter input
This fixes an issue where labels couldn’t be activated if e.g. NumLock
was enabled.
2022-04-20 21:50:49 +02:00
Daniel Eklöf
6ed9a31007
changelog: move “re-mapping input” from “changed” to “added” 2022-04-20 20:56:04 +02:00
Daniel Eklöf
e4d085a17b
input: codespell 2022-04-20 19:03:48 +02:00
Daniel Eklöf
0504a3e71a
input: copy libxkbcommon’s keysym_is_modifier()
When determining whether a keysym is a modifier (to skip hiding the
pointer when [mouse].hide-when-typing=yes), use the same matching
logic xkbcommon does.

This function, xkb_keysym_is_modifier() is unfortunately not part of
the public API, which is why we copy it instead.
2022-04-20 18:23:20 +02:00
Daniel Eklöf
8485cdaaaa
csi: implement CSI > 4n (reset modifyOtherKeys) 2022-04-19 17:25:06 +02:00
Daniel Eklöf
876044df8d
wayland: remove selection_override_modmask member
This member is no longer valid - we need to use one from the current
key-binding set.
2022-04-19 17:24:25 +02:00
Daniel Eklöf
e3683b58fc
search: add comment to ‘advance_pos()’ macro 2022-04-18 15:12:56 +02:00
Daniel Eklöf
b3d18e3c8d
search: codespell: backards -> backwards 2022-04-18 15:06:20 +02:00
Daniel Eklöf
006c75d2d3
search: rename ‘newline’ -> ‘advance_pos’ macro, reverse return value 2022-04-18 14:57:31 +02:00
Daniel Eklöf
2898ec70b6
search: input: log consumed modifiers 2022-04-18 14:57:13 +02:00
Daniel Eklöf
7b1994fce6
search: match iterator: wrap iterator’s row number, when needed 2022-04-18 14:47:17 +02:00
Daniel Eklöf
a9ed719f90
search: find_next(): assert start/end coords are valid 2022-04-18 14:47:07 +02:00
Daniel Eklöf
a46d7d95c6
search: find_next(): stop at the exact cell position specified by ‘end’
And not just when reaching end’s row.
2022-04-18 14:43:01 +02:00
Daniel Eklöf
b58ab2fd48
search: find_next(): prefix {start,end}_{row_col} with ‘match’ 2022-04-18 12:38:09 +02:00
Daniel Eklöf
9117ebebef
search: find_next(): pass an ‘end’ coord, instead of a row count 2022-04-18 12:31:07 +02:00
Daniel Eklöf
4cdae0c05b
search: refactor: find_next(): pass start as a ‘coord’ struct 2022-04-18 12:17:49 +02:00
Daniel Eklöf
68db8ff1f5
search: search_update_selection() no longer expects end coordinate to be exclusive 2022-04-18 00:01:24 +02:00
Daniel Eklöf
529da8e238
search: match iterator: handle overlapping matches 2022-04-17 19:40:51 +02:00
Daniel Eklöf
2085621bf4
render: overlay: reset ‘start_col’ after handling the first row 2022-04-17 19:26:54 +02:00
Daniel Eklöf
3905212651
search: match iterator: always return the primary match
Normally, the primary match is automatically included by the iterator,
but if the secondary and primary matches overlap, it is possible we
don’t return the _actual_ primary match. This lead to highlighting
issues, where part of the primary match wasn’t highlighted correctly.
2022-04-17 19:22:28 +02:00
Daniel Eklöf
c5519e2aa6
search: fix next/prev not updating selection correctly when matches overlap
When the new match overlapped with the old match, the selection wasn’t
updated correctly.
2022-04-17 19:16:47 +02:00
Daniel Eklöf
24ee3dcc10
wayland: refactor: remove ‘struct config’ pointer from wayland struct
The global config doesn’t necessarily reflect the correct
configuration to use - we should *always* use the current terminal
instance’s conf pointer.

* Move selection override modifier mask to the key_binding_set struct
* Always warn if XDG activation is unavailable, not just if
  bell.urgent is set (we no longer have access to this information)
* Pass ‘bool presentation_timings’ as a parameter to wayl_init()
* Remove ‘presentation_timings’ member from the ‘terminal’ struct

Closes #932
2022-04-17 16:34:04 +02:00
Daniel Eklöf
7a5e5a80b9
key-binding: NOINLINE a couple of functions, for a minor code size reduction 2022-04-17 16:11:39 +02:00
Daniel Eklöf
8046e5560a
changelog: key binding overrides having no effect with footclient 2022-04-17 16:01:30 +02:00
Daniel Eklöf
90a2ca966f
key-binding: new API, for handling sets of key bindings
Up until now, our Wayland seats have been tracking key bindings. This
makes sense, since the seat’s keymap determines how the key bindings
are resolved.

However, tying bindings to the seat/keymap alone isn’t enough, since
we also depend on the current configuration (i.e. user settings) when
resolving a key binding.

This means configurations that doesn’t match the wayland object’s
configuration, currently don’t resolve key bindings correctly. This
applies to footclients where the user has overridden key bindings on
the command line (e.g. --override key-bindings.foo=bar).

Thus, to correctly resolve key bindings, each set of key bindings must
be tied *both* to a seat/keymap, *and* a configuration.

This patch introduces a key-binding manager, with an API to
add/remove/lookup, and load/unload keymaps from sets of key bindings.

In the API, sets are tied to a seat and terminal instance, since this
makes the most sense (we need to instantiate, or incref a set whenever
a new terminal instance is created). Internally, the set is tied to a
seat and the terminal’s configuration.

Sets are *added* when a new seat is added, and when a new terminal
instance is created. Since there can only be one instance of each
seat, sets are always removed when a seat is removed.

Terminals on the other hand can re-use the same configuration (and
typically do). Thus, sets ref-count the configuration. In other words,
when instantiating a new terminal, we may not have to instantiate a
new set of key bindings, but can often be incref:ed instead.

Whenever the keymap changes on a seat, all key bindings sets
associated with that seat reloads (re-resolves) their key bindings.

Closes #931
2022-04-17 15:39:51 +02:00
Daniel Eklöf
e95bc9283e
meson: install foot.ini to /etc/xdg/foot/foot.ini
Closes #1001
2022-04-17 11:27:53 +02:00
Daniel Eklöf
501a9fbb5e
url-mode: add a key binding that enables “persistent” URL mode
This is an alternative to ‘show-urls-launch’, where we stay in URL
mode after activating an URL.

Closes #964
2022-04-17 11:24:27 +02:00