<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/selection.c, branch 1.2.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.2.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.2.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-02-14T21:39:26Z</updated>
<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>
<entry>
<title>selection: selection_cancel() now sets 'kind' to SELECTION_NONE</title>
<updated>2020-01-04T11:09:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T11:09:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2a531327dde3c86edea2baf9503d08545d8f4767'/>
<id>urn:sha1:2a531327dde3c86edea2baf9503d08545d8f4767</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: store cell 'selected' state in the cells' attributes</title>
<updated>2020-01-04T11:03:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T11:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f12b1473fde2045d38750aa1051ad624e0fea2bc'/>
<id>urn:sha1:f12b1473fde2045d38750aa1051ad624e0fea2bc</id>
<content type='text'>
Instead of having the renderer calculate, for each cell, whether that
cell is currently selected or not, make selection_update() mark/unmark
the selected cells.

The renderer now only has to look at the cells' 'selected'
attribute. This makes the renderer both smaller and faster.
</content>
</entry>
<entry>
<title>selection: track selection type; normal or block selection</title>
<updated>2020-01-03T22:29:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T22:29:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d706e6828062aa35505d3893fb3c04b84985aa29'/>
<id>urn:sha1:d706e6828062aa35505d3893fb3c04b84985aa29</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: remove unneeded wayland display roundtrips</title>
<updated>2020-01-03T20:01:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T20:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c6e46bbfac8d71ad4b5f632bfd00bdc4599b9483'/>
<id>urn:sha1:c6e46bbfac8d71ad4b5f632bfd00bdc4599b9483</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: optimize \r\n -&gt; \n when receiving clipboard data</title>
<updated>2019-12-15T11:11:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-15T11:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2f475d7b44fd2e0426c0b96d980605debaede15a'/>
<id>urn:sha1:2f475d7b44fd2e0426c0b96d980605debaede15a</id>
<content type='text'>
Instead of first memmoving, possibly lots of data lots of times, the
received buffer, and _then_ calling the callback, simply call the
callback multiple times, and just skip the \r character(s).
</content>
</entry>
<entry>
<title>selection: break out isword() to a new file</title>
<updated>2019-12-03T18:16:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-03T18:16:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=198529525c788f51babcd425ea7dcdb4d8125c04'/>
<id>urn:sha1:198529525c788f51babcd425ea7dcdb4d8125c04</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: add term_mouse_grabbed()</title>
<updated>2019-11-30T16:06:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-30T16:06:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2208f4304b799dbaaf52629d8ef3ce5629f16184'/>
<id>urn:sha1:2208f4304b799dbaaf52629d8ef3ce5629f16184</id>
<content type='text'>
When this returns true, it means we have keyboard focus and are
grabbing the mouse (for e.g. selections), regardless of whether the
client has enabled mouse tracking or not.
</content>
</entry>
</feed>
