<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/search.c, branch 1.12.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.12.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.12.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-04-21T16:54:27Z</updated>
<entry>
<title>search: don't modify search.start coord *before* finding next match</title>
<updated>2022-04-21T16:54:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-21T16:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9907d7bbe956840d75630702b6f48ee5be60f61f'/>
<id>urn:sha1:9907d7bbe956840d75630702b6f48ee5be60f61f</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>search: add comment to ‘advance_pos()’ macro</title>
<updated>2022-04-18T13:12:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T13:12:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e3683b58fc291f363c52e698db003683824fd550'/>
<id>urn:sha1:e3683b58fc291f363c52e698db003683824fd550</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: codespell: backards -&gt; backwards</title>
<updated>2022-04-18T13:06:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T13:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b3d18e3c8d7d822921d99920304a0b16b064b82f'/>
<id>urn:sha1:b3d18e3c8d7d822921d99920304a0b16b064b82f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: rename ‘newline’ -&gt; ‘advance_pos’ macro, reverse return value</title>
<updated>2022-04-18T12:57:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T12:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=006c75d2d3bff050ec5cb40b73c02c7b35608549'/>
<id>urn:sha1:006c75d2d3bff050ec5cb40b73c02c7b35608549</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: input: log consumed modifiers</title>
<updated>2022-04-18T12:57:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T12:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2898ec70b60ed420c5caca433dc126ad54ea51f2'/>
<id>urn:sha1:2898ec70b60ed420c5caca433dc126ad54ea51f2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: match iterator: wrap iterator’s row number, when needed</title>
<updated>2022-04-18T12:47:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T12:47:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7b1994fce62fd18744eeb935611b6a08fae2f538'/>
<id>urn:sha1:7b1994fce62fd18744eeb935611b6a08fae2f538</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: find_next(): assert start/end coords are valid</title>
<updated>2022-04-18T12:47:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T12:47:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a9ed719f9098920cc2c1625374f1e4c0658a5576'/>
<id>urn:sha1:a9ed719f9098920cc2c1625374f1e4c0658a5576</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: find_next(): stop at the exact cell position specified by ‘end’</title>
<updated>2022-04-18T12:43:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T12:43:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a46d7d95c6d908b0c341400523c2883f58f409ba'/>
<id>urn:sha1:a46d7d95c6d908b0c341400523c2883f58f409ba</id>
<content type='text'>
And not just when reaching end’s row.
</content>
</entry>
<entry>
<title>search: find_next(): prefix {start,end}_{row_col} with ‘match’</title>
<updated>2022-04-18T10:38:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T10:38:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b58ab2fd48ad4b31ed47d6ab8bf7cfd5b4080398'/>
<id>urn:sha1:b58ab2fd48ad4b31ed47d6ab8bf7cfd5b4080398</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: find_next(): pass an ‘end’ coord, instead of a row count</title>
<updated>2022-04-18T10:31:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T10:31:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9117ebebef20693db695222e8b4fabc3af57f82b'/>
<id>urn:sha1:9117ebebef20693db695222e8b4fabc3af57f82b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: refactor: find_next(): pass start as a ‘coord’ struct</title>
<updated>2022-04-18T10:17:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-18T10:17:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4cdae0c05ba0e888a7ff21a829375d67d2e11d6b'/>
<id>urn:sha1:4cdae0c05ba0e888a7ff21a829375d67d2e11d6b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: search_update_selection() no longer expects end coordinate to be exclusive</title>
<updated>2022-04-17T22:01:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T22:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=68db8ff1f58bf167fb2eea6747bea3ee7e8a2459'/>
<id>urn:sha1:68db8ff1f58bf167fb2eea6747bea3ee7e8a2459</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: match iterator: handle overlapping matches</title>
<updated>2022-04-17T17:40:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T17:40:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=529da8e238a21a5519a7f6bb31ad447a529a7a02'/>
<id>urn:sha1:529da8e238a21a5519a7f6bb31ad447a529a7a02</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: match iterator: always return the primary match</title>
<updated>2022-04-17T17:22:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T17:17:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3905212651628d4446f817aa3722a26684d48828'/>
<id>urn:sha1:3905212651628d4446f817aa3722a26684d48828</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>search: fix next/prev not updating selection correctly when matches overlap</title>
<updated>2022-04-17T17:16:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T17:16:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c5519e2aa6aacc7b552bd4d629b21e00051c211a'/>
<id>urn:sha1:c5519e2aa6aacc7b552bd4d629b21e00051c211a</id>
<content type='text'>
When the new match overlapped with the old match, the selection wasn’t
updated correctly.
</content>
</entry>
<entry>
<title>key-binding: new API, for handling sets of key bindings</title>
<updated>2022-04-17T13:39:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T13:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=90a2ca966f657e5fdd82997aad9663e9984f3cc9'/>
<id>urn:sha1:90a2ca966f657e5fdd82997aad9663e9984f3cc9</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>search: refactor: search_update_selection() takes a ‘struct range’</title>
<updated>2022-04-16T18:23:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T18:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=074bbf767e832c68c68ddfd75d01d891eef4049d'/>
<id>urn:sha1:074bbf767e832c68c68ddfd75d01d891eef4049d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: break out “find next match” logic to a new function</title>
<updated>2022-04-16T18:13:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T18:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bd089c845f32016e450eced3cfbf9e82657fb771'/>
<id>urn:sha1:bd089c845f32016e450eced3cfbf9e82657fb771</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search/render: initial support for highlighting all visible matches</title>
<updated>2022-04-16T17:26:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-09T15:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=90c91d61482920881bb0c1ecf4babc001b3f598d'/>
<id>urn:sha1:90c91d61482920881bb0c1ecf4babc001b3f598d</id>
<content type='text'>
Before this patch, only the currently “selected” match was
highlighted (by having the “selected” attribute, and by *not* dimming
it, like the rest of the grid during a scrollback search).

With this patch, we now highlight matches within the viewport. While
searching, only the “primary” match is searched-for, and tracked.

Then, when rendering a frame, we find all “secondary” matches as
well. “holes” are added to the search-mode overlay by the means of an
search-match iterator.

The iterator’s text matching logic is *very* similar to what we do
when the search criteria has been updated, and we re-search the
scrollback. It should be possible to refactor this, and share code.
</content>
</entry>
<entry>
<title>wayland: optionally disable pointer input on subsurfaces</title>
<updated>2022-04-16T15:41:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T15:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=129deaffa82650a1383f5816aa46f4a78a73b2ed'/>
<id>urn:sha1:129deaffa82650a1383f5816aa46f4a78a73b2ed</id>
<content type='text'>
We have a number of sub-surfaces for which we are *not* interrested in
pointer (or touch) input.

Up until now, we’ve manually dealt with these, by recognizing these
surfaces in all pointer events, and ignoring them.

But, lo and behold, there are better ways of doing this. By clearing
the subsurface’s input region, the compositor will do this for us -
when a pointer is outside a surface’s input region, the event is
passed to the next surface underneath it.

This is exactly what we want! Do this for all subsurfaces, *except*
the CSDs.
</content>
</entry>
</feed>
