<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/selection.c, branch releases/1.4</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.4</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.4'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-07-29T04:57:22Z</updated>
<entry>
<title>input: margins are not selectable</title>
<updated>2020-07-29T04:57:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-26T10:31:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d675cf872022e0e1bf2100211d7607773de1016c'/>
<id>urn:sha1:d675cf872022e0e1bf2100211d7607773de1016c</id>
<content type='text'>
* Fix col/row calculation in pointer-enter event; we did not take the
  margins into account.
* seat-&gt;mouse.col,row are now set to -1 if the cursor is inside the
  margins. That is, col/row are only ever valid when the mouse is
  actually over the grid, and not in the margins.
* Use regular 'left-ptr' mouse cursor when mouse is inside the
  margins, to not make the user think he/she can start a selection.

Besides making things clearer, this also fixes a crash that occurred
if you started a selection in e.g. the right margin.
</content>
</entry>
<entry>
<title>selection: extending a selection is now interactive</title>
<updated>2020-07-27T14:44:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-27T14:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7127a0a6c393ee888a7b640c5481e191e0744519'/>
<id>urn:sha1:7127a0a6c393ee888a7b640c5481e191e0744519</id>
<content type='text'>
That is, a selection extension can be resized just like an ordinary
extension.
</content>
</entry>
<entry>
<title>selection: provide a const-wrapper for extract_one()</title>
<updated>2020-07-15T09:31:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-15T09:31:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ffaa19ee22ec00da01d23748f78253ad5c2253de'/>
<id>urn:sha1:ffaa19ee22ec00da01d23748f78253ad5c2253de</id>
<content type='text'>
extract_one() takes const pointers, while the callback argument to
foreach() expects non-const.
</content>
</entry>
<entry>
<title>selection: refactor: break out text extraction to a separate file</title>
<updated>2020-07-15T09:19:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-15T09:19:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=aafa120f92b2f41d1a753493676ee7ee0cb7a1ff'/>
<id>urn:sha1:aafa120f92b2f41d1a753493676ee7ee0cb7a1ff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: don't skip SPACER cells in the generic foreach()</title>
<updated>2020-07-15T07:22:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-15T07:22:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bead6f36d6c5793baa1dd307c6a4e6fbeda46586'/>
<id>urn:sha1:bead6f36d6c5793baa1dd307c6a4e6fbeda46586</id>
<content type='text'>
As that breaks e.g. selection marking (SPACER cells didn't get
inverted when rendered).

Instead, skip them in extract_one() only. I.e. when copying text from
the grid.
</content>
</entry>
<entry>
<title>selection: row-&gt;dirty is a boolean</title>
<updated>2020-07-15T07:21:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-15T07:21:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=540864521e66589ff0ee7ed250e0a07f29fa0a34'/>
<id>urn:sha1:540864521e66589ff0ee7ed250e0a07f29fa0a34</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: no need to try to detect multi-column chars at the end of the line</title>
<updated>2020-07-14T15:06:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T15:06:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a2af13a1260b70e59a465debc890d40cd7103964'/>
<id>urn:sha1:a2af13a1260b70e59a465debc890d40cd7103964</id>
<content type='text'>
This is handled by the generic foreach() functions, which now simply
skips spacer cells.
</content>
</entry>
<entry>
<title>term: print: write special value CELL_MULT_COL_SPACER to extra cells</title>
<updated>2020-07-14T14:49:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T14:49:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=df2927e088ceb2119264d1a970c22a450f00005b'/>
<id>urn:sha1:df2927e088ceb2119264d1a970c22a450f00005b</id>
<content type='text'>
When printing a multi-column character, write CELL_MULT_COL_SPACER
instead of '0' to both padding cells (when character doesn't fit at
the end of the line), and to the cells following the actual character.
</content>
</entry>
<entry>
<title>term: rename COMB_CHARS_LO,HI -&gt; CELL_COMB_CHARS_LO,HI</title>
<updated>2020-07-14T14:41:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T14:41:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5c99e8013b3e8fb68e55250be550e856636ccf7b'/>
<id>urn:sha1:5c99e8013b3e8fb68e55250be550e856636ccf7b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: recognize empty padding cells in a forced linewrap</title>
<updated>2020-07-14T11:17:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T11:17:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4cf7195695e2112031c630ff1102beb0f7f57e4d'/>
<id>urn:sha1:4cf7195695e2112031c630ff1102beb0f7f57e4d</id>
<content type='text'>
When printing a multi-column character at the end of the line, and it
doesn't fit, we currently insert a forced line-wrap. This means the
last character(s) on the previous line will be empty, followed by a
multi-column character in the first cell on the next line.

Without special code to handle this, the selection text extraction
code will insert a hard newline, since this is normally the correct
thing to do.

Add a TODO, to consider writing a special place holder value to these
padding cells.
</content>
</entry>
<entry>
<title>selection: foreach: don't call callback for trailing multi-character cells</title>
<updated>2020-07-14T10:59:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T10:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3bc404b5a353194252415d1a1594aef7c831f091'/>
<id>urn:sha1:3bc404b5a353194252415d1a1594aef7c831f091</id>
<content type='text'>
</content>
</entry>
<entry>
<title>seat: use separate 'enter' serials for keyboard and mouse</title>
<updated>2020-07-09T09:20:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-09T09:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=71584aed388935908588686e5df7ec42855f3698'/>
<id>urn:sha1:71584aed388935908588686e5df7ec42855f3698</id>
<content type='text'>
</content>
</entry>
<entry>
<title>multi-seat: improve handling of multiple (mouse) pointers</title>
<updated>2020-07-09T07:52:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-09T07:52:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4e48d550efba98ebecf4b60045004e52c585c52d'/>
<id>urn:sha1:4e48d550efba98ebecf4b60045004e52c585c52d</id>
<content type='text'>
* xcursor always set for all pointers
* xcursor sometimes not updated when it should be
* mouse grabbed state wasn't per seat, but global (i.e. "does at least
  one seat enable mouse grabbing")
* selection enabled state wasn't per seat
</content>
</entry>
<entry>
<title>multi-seat: re-enable selection support (excluding OSC 52)</title>
<updated>2020-07-08T16:41:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-08T16:41:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4c7d29f7eb95b10a0fadc406924db537a18b12ca'/>
<id>urn:sha1:4c7d29f7eb95b10a0fadc406924db537a18b12ca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wip: multi-seat support</title>
<updated>2020-07-08T14:45:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-08T14:45:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c47082506714f458e999f6ff1bf3099dfc4c0c0c'/>
<id>urn:sha1:c47082506714f458e999f6ff1bf3099dfc4c0c0c</id>
<content type='text'>
Compiles and runs, but mouse, clipboard and other things have been
disabled.
</content>
</entry>
<entry>
<title>selection: fix typo when extending selection to cover double-width character</title>
<updated>2020-06-03T15:31:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-03T15:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=159bfddb87040b5d1f3452db1e23015bdf551831'/>
<id>urn:sha1:159bfddb87040b5d1f3452db1e23015bdf551831</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: don't allow only half of double-width characters to be selected</title>
<updated>2020-06-02T16:21:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-02T16:21:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=056fd4ffe0d6f031638940383721f62318b6e631'/>
<id>urn:sha1:056fd4ffe0d6f031638940383721f62318b6e631</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: performance: check for &lt; 0 or &gt;= 0 instead of == -1</title>
<updated>2020-05-19T16:51:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-19T16:51:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8ad3b9c172fdab0a4513d1045ca0eb23ab66f93d'/>
<id>urn:sha1:8ad3b9c172fdab0a4513d1045ca0eb23ab66f93d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: handle viewport wrap around correctly</title>
<updated>2020-05-19T16:49:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-19T16:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=08588cd0fc25128a8ec013d65ca15d8e66d28e99'/>
<id>urn:sha1:08588cd0fc25128a8ec013d65ca15d8e66d28e99</id>
<content type='text'>
When the viewport wraps around, the selection points may be
"incorrect".
</content>
</entry>
<entry>
<title>term: scrolling: hopefully fix all selection/scrolling related crashes</title>
<updated>2020-05-17T13:34:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-17T13:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=96a4f1b9933756e7466132095ef7151c46db04ae'/>
<id>urn:sha1:96a4f1b9933756e7466132095ef7151c46db04ae</id>
<content type='text'>
When scrolling, there are a couple of cases where an existing
selection must be canceled because we cannot meaningfully represent it
after scrolling.

These are when the selection is (partly) inside:

* The top scrolling region
* The bottom scrolling region
* The new lines scrolled in. I.e. re-used lines

For the scrolling regions, the real problem is when the selection
crosses the scrolling region boundary; a selection that is completely
inside a scrolling regions _might_ be possible to keep, but we would
need to translate the selection coordinates to the new scrolling
region lines.

For simplicity, we cancel the selection if it touches the scrolling
region. Period.

The last item, newly scrolled in lines is when the selection covers
very old lines and we're now wrapping around the scrollback history.

Then there's a fourth problem case: when the user has started a
selection, but hasn't yet moved the cursor. In this case, we have no
end point.

What's more problematic is that when the user (after scrolling) moves
the cursor, we try to create a huge selection that covers mostly
empty (NULL) rows, causing us to crash.

This can happen e.g. when reverse scrolling in such a way that we wrap
around the scrollback history.

The actual viewport in this case is something like `-n - m`. But the
selection we'll end up trying to create will be `m - (rows - n)`. This
range may very well contain NULL rows.

To deal with this, we simply cancel the selection.
</content>
</entry>
</feed>
