<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/selection.c, branch 1.3.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.3.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.3.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-05-03T09:03:22Z</updated>
<entry>
<title>unicode-combining: store seen combining chains "globally" in the term struct</title>
<updated>2020-05-03T09:03:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-03T09:03:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=62e07743194c8051334ed9b23be90ce31ab80773'/>
<id>urn:sha1:62e07743194c8051334ed9b23be90ce31ab80773</id>
<content type='text'>
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.

When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.

When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is &gt;= COMB_CHARS_LO).

Then we render the grapheme pretty much like before.
</content>
</entry>
<entry>
<title>unicode-combine: remove utf8proc dependency</title>
<updated>2020-05-02T15:29:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-02T15:29:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d945b68b734427a03d114716ff8aeac7998a7c57'/>
<id>urn:sha1:d945b68b734427a03d114716ff8aeac7998a7c57</id>
<content type='text'>
We only used utf8proc to try to pre-compose a glyph from a base and
combining character.

We can do this ourselves by using a pre-compiled table of valid
pre-compositions. This table isn't _that_ big, and binary searching it
is fast.

That is, for a very small amount of code, and not too much extra RO
data, we can get rid of the utf8proc dependency.
</content>
</entry>
<entry>
<title>unicode-combining: completely remove unicode combining characters when feature is disabled</title>
<updated>2020-05-01T10:05:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-01T10:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3474624c2c17058f0fd9f3f1821971e7213d285b'/>
<id>urn:sha1:3474624c2c17058f0fd9f3f1821971e7213d285b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: extract text: also copy combining characters</title>
<updated>2020-05-01T09:59:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-01T09:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=623329cf23dc1309eec1338c52417d25141f44d6'/>
<id>urn:sha1:623329cf23dc1309eec1338c52417d25141f44d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>util.h: new header file defining commonly used macros</title>
<updated>2020-05-01T09:46:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-01T09:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=69c3e744983e37662fa7b4f61482fb1d142e257c'/>
<id>urn:sha1:69c3e744983e37662fa7b4f61482fb1d142e257c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: extend: new row must be offsetted with the current view offset</title>
<updated>2020-04-04T10:05:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-04T10:05:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=035eccbb13653695c088ea49672315a589b9db59'/>
<id>urn:sha1:035eccbb13653695c088ea49672315a589b9db59</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: add selection_extend()</title>
<updated>2020-04-04T09:59:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-04T09:59:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=aa01521ff668f201ba4297bf0558a76835144cb5'/>
<id>urn:sha1:aa01521ff668f201ba4297bf0558a76835144cb5</id>
<content type='text'>
This function extends an existing selection in the following way:

If the extension point is *before* the upper boundary of the current
selection, extend the selection upwards.

If the extension point is *after* the bottom boundary of the current
selection, extend the selection downwards.

If the extension point is *inside* the current selection, shrink the
selection such that the new size is maximized. This means we move the
*closest* start/end point from in the current selection.
</content>
</entry>
<entry>
<title>term: convert cell 'linefeed' attribute to a row 'linebreak' property</title>
<updated>2020-02-14T21:39:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-14T21:39:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ce8005545d5bc94775f616d0caacd55e691e400f'/>
<id>urn:sha1:ce8005545d5bc94775f616d0caacd55e691e400f</id>
<content type='text'>
To do text reflow, we only need to know if a line has been explicitly
linebreaked or not. If not, that means it wrapped, and that we
should *not* insert a linebreak when reflowing text.

When reflowing text, when reaching the end of a row in the old grid,
only insert a linebreak in the new grid if the old row had been
explicitly linebreaked.

Furthermore, when reflowing text and wrapping a row in the new grid,
mark the previous row as linebreaked if either the last cell was
(the last column in the last row) empty, or the current cell (the
first column in the new row) is empty. If both are non-empty, then we
assume a linewrap.
</content>
</entry>
<entry>
<title>selection: handle line break at last column correctly</title>
<updated>2020-02-11T18:36:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-11T18:36:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b28a742a0032bbd54c6429257e06d453b131e0fa'/>
<id>urn:sha1:b28a742a0032bbd54c6429257e06d453b131e0fa</id>
<content type='text'>
Insert a newline into the selection even if the last column contained
a printable character, *if* that column also has linefeed=1.
</content>
</entry>
<entry>
<title>Revert "selection: use edge-triggered FDM handlers"</title>
<updated>2020-01-10T18:49:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-10T18:49:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3957d50a8a19f2b0cdd844101092b4ffbc9f61b7'/>
<id>urn:sha1:3957d50a8a19f2b0cdd844101092b4ffbc9f61b7</id>
<content type='text'>
This reverts commit 5bac3cfa2cb6a1e7b6eb0012c134bd2e844fcf61.
</content>
</entry>
<entry>
<title>selection: use edge-triggered FDM handlers</title>
<updated>2020-01-10T18:24:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-10T18:24:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5bac3cfa2cb6a1e7b6eb0012c134bd2e844fcf61'/>
<id>urn:sha1:5bac3cfa2cb6a1e7b6eb0012c134bd2e844fcf61</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: finalize: ignore whether selections are 'enabled' or not</title>
<updated>2020-01-06T10:59:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-06T10:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=40bb63e2061d8dbb82ba5caec786699d5dc7a9a3'/>
<id>urn:sha1:40bb63e2061d8dbb82ba5caec786699d5dc7a9a3</id>
<content type='text'>
This fixes an issue where a "forced" selection (shift being pressed
while slave is tracking mouse events) would not finalize if the user
released shift *before* releasing the mouse button.
</content>
</entry>
<entry>
<title>selection: update: don't dirty cells that don't change state</title>
<updated>2020-01-06T10:56:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-06T10:56:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=457eb573c441826d4b3843c6c0ad36de097f17d7'/>
<id>urn:sha1:457eb573c441826d4b3843c6c0ad36de097f17d7</id>
<content type='text'>
Previously when updating a selection, we would unmark *all* cells in
the old selection, and then mark all cells in the new selection.

This caused *all* cells to be dirtied and thus re-rendered.

Avoid this, by adding a temporary state to the cells' selected state.

Before unmarking the old selection, pre-mark the new selection using a
temporary state.

When unmarking the old selection, ignore cells in this temporary state.
When marking the new selection, ignore cells in this temporary
state (except clearing the temporary state).
</content>
</entry>
<entry>
<title>selection: foreach_selection_*: must wrap row number</title>
<updated>2020-01-05T14:38:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-05T14:38:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6833abf33cb168716bf57f9eb170a293fe918d53'/>
<id>urn:sha1:6833abf33cb168716bf57f9eb170a293fe918d53</id>
<content type='text'>
Fixes occasional crashes when we're at the end of the grid and
selection wraps around.
</content>
</entry>
<entry>
<title>selection: min_bufsize_for_extraction: add one extra column for *all* rows</title>
<updated>2020-01-04T13:06:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T13:06:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a83c9e28137158fe0fb68a0e163e0305ca14ddeb'/>
<id>urn:sha1:a83c9e28137158fe0fb68a0e163e0305ca14ddeb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: rename selection_cell_count -&gt; min_bufsize_for_extraction</title>
<updated>2020-01-04T12:56:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T12:56:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4c78b0203e89b20394ac0fa3a83973d923805ed6'/>
<id>urn:sha1:4c78b0203e89b20394ac0fa3a83973d923805ed6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: cell count now adds one extra column per row, for \n</title>
<updated>2020-01-04T12:53:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T12:53:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e6f04832949c97e829b21a2f5f71e268de00c7eb'/>
<id>urn:sha1:e6f04832949c97e829b21a2f5f71e268de00c7eb</id>
<content type='text'>
When we extract text, we may insert '\n' at the end of each line (or
last column of selection, for block selections).

These newlines doesn't occupy any physical cells, and thus we
must **make** room for them in the extraction buffer.
</content>
</entry>
<entry>
<title>selection: fix bug where first column on all rows but the first was lost</title>
<updated>2020-01-04T12:19:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T12:19:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6ee86be1bf881f99533cc660123c6992f19f20f4'/>
<id>urn:sha1:6ee86be1bf881f99533cc660123c6992f19f20f4</id>
<content type='text'>
When extracting text from the selection, we lost the first column on
all rows but the first.

This is because the algorithm changed slightly when we moved to
foreach_selection(); the end-of-line detection is now done on the
first column of the new line, instead of the last column on the
previous line.
</content>
</entry>
<entry>
<title>selection: simplify extraction by converting to UTF-8 at the end</title>
<updated>2020-01-04T12:09:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T12:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e28cb989d84c14f1026c263419462bfdd3d58e2d'/>
<id>urn:sha1:e28cb989d84c14f1026c263419462bfdd3d58e2d</id>
<content type='text'>
Instead of converting a cell at a time to UTF-8, copy the wide
characters as is, and then convert everything at once at the end.
</content>
</entry>
<entry>
<title>selection: extract_selection now uses foreach_selected()</title>
<updated>2020-01-04T12:01:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T11:59:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=975a35ae16949495076c3377573e906422de97ba'/>
<id>urn:sha1:975a35ae16949495076c3377573e906422de97ba</id>
<content type='text'>
This "automagically" adds support for block selections, since
foreach_selected already handles block selections.
</content>
</entry>
</feed>
