<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/selection.h, branch 1.10.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.10.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.10.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-05-17T16:14:09Z</updated>
<entry>
<title>selection: expose find_word_boundary_{left,right}()</title>
<updated>2021-05-17T16:14:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-28T19:03:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=eab874eb06de11763683f312e6c1557319788cee'/>
<id>urn:sha1:eab874eb06de11763683f312e6c1557319788cee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: remove selection_enabled()</title>
<updated>2021-02-02T08:52:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-02T08:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=eff8481cdc6c37407faaa3167ea6f6897b12f544'/>
<id>urn:sha1:eff8481cdc6c37407faaa3167ea6f6897b12f544</id>
<content type='text'>
Its name did not reflect its semantics. Since it was only used in a
single place, “inline” it there, and get rid of it.
</content>
</entry>
<entry>
<title>config: add ‘select-extend-character-wise’ bind action</title>
<updated>2021-01-14T15:29:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-06T10:11:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=767bd4f1dbbb14d9d28acb22cf42a91e6305a69a'/>
<id>urn:sha1:767bd4f1dbbb14d9d28acb22cf42a91e6305a69a</id>
<content type='text'>
This forces the (new) selection mode to be character-wise when
extending a word- or line-wise selection.

Default key binding is ctrl+RMB.
</content>
</entry>
<entry>
<title>selection: combine enum selection_kind with selection_semantic</title>
<updated>2021-01-06T09:53:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-06T09:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3a9172342fd69c09d3fddfb26eba12dcbe1e5149'/>
<id>urn:sha1:3a9172342fd69c09d3fddfb26eba12dcbe1e5149</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: use selection_start() to initialize word/row-based selection</title>
<updated>2021-01-04T18:48:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-02T22:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3afc5a723e10313f956234cfd4251ba7a5a7e99c'/>
<id>urn:sha1:3afc5a723e10313f956234cfd4251ba7a5a7e99c</id>
<content type='text'>
This removes the selection_mark_word() and selection_mark_row()
functions. To start a word/row-based selection, use selection_start()
with SELECTION_SEMANTIC_{WORD,ROW}
</content>
</entry>
<entry>
<title>selection: wip: update selection word-wise when initial selection was by word</title>
<updated>2021-01-04T18:48:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-02T20:20:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=30de262d29d703b0cc31799a4abf84239f3caf22'/>
<id>urn:sha1:30de262d29d703b0cc31799a4abf84239f3caf22</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selection: add support for different mime-types</title>
<updated>2020-10-28T18:16:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-28T18:16:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=be22fefdc73c8b2ca8375a1b3f19c8d05de18e24'/>
<id>urn:sha1:be22fefdc73c8b2ca8375a1b3f19c8d05de18e24</id>
<content type='text'>
Add support for `text/plain`, `text/plain;charset=utf-8` and
`text/uri-list` to regular copy operations (both from clipboard and
primary selection) and drag-and-drop operations.
</content>
</entry>
<entry>
<title>selection: auto-scroll: selection keeps scrolling while mouse is outside grid</title>
<updated>2020-10-11T13:44:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-11T13:44:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7fedf2f80160d4cb96b77ae58137573b78cbfeee'/>
<id>urn:sha1:7fedf2f80160d4cb96b77ae58137573b78cbfeee</id>
<content type='text'>
Moving the mouse outside the grid while we have an on-going selection
now starts a timer. The interval of this timer depends on the mouse’s
distance from the grid - the further away the mouse is, the shorter
interval.

On each timer timeout, we scroll one line, and update the
selection. Thus, the shorter the interval, the faster we scroll.

The timer is canceled as soon as the mouse enters the grid again, or
the selection is either canceled or finalized.

The timer FD is created and destroyed on-demand.

Most of the logic is now in selection.c. The exception is the
calculation of the timer interval, which depends on the mouse’s
position. Thus, this is done in input.c.

The scroll+selection update logic needs to know a) which direction
we’re scrolling in, and b) which *column* the selection should be
updated with.

If the mouse is outside the grid’s left or right margins, the stored
mouse column will be -1. I.e. we don’t know whether the mouse is on
the left or right side of the grid. This is why the caller, that
starts the timer, must provide this value.

The same applies to top and bottom margins, but since we already have
the scroll *direction*, which row value to use can be derived from this.
</content>
</entry>
<entry>
<title>selection: add selection_&lt;type&gt;_has_data()</title>
<updated>2020-09-09T17:01:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-09T16:45:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dec6f963cbedb093370f8d9559e357e72a31df90'/>
<id>urn:sha1:dec6f963cbedb093370f8d9559e357e72a31df90</id>
<content type='text'>
Returns true when there is data available for paste in the
clipboard/primary selection.
</content>
</entry>
<entry>
<title>selection: add selection_&lt;type&gt;_unset()</title>
<updated>2020-09-09T17:01:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-09T16:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c3cacb470430f3a19db8e2442f1ed61887044373'/>
<id>urn:sha1:c3cacb470430f3a19db8e2442f1ed61887044373</id>
<content type='text'>
These functions clear the current selection.
</content>
</entry>
<entry>
<title>config: add 'pipe-selected' key binding</title>
<updated>2020-07-31T15:04:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-31T15:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=639a61abd86c7db3e47f2cd70fc16b7d6c6afaf4'/>
<id>urn:sha1:639a61abd86c7db3e47f2cd70fc16b7d6c6afaf4</id>
<content type='text'>
This works just like pipe-visible and pipe-scrollback, but pipes the
user-selected text, if any, to the external tool.

Closes #51
</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>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>
<entry>
<title>selection/render: sync cells' 'selected' bit before rendering</title>
<updated>2020-05-16T19:36:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-16T19:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a8ccb0ffaeda73df855fd3fb70a83e718faa9ec'/>
<id>urn:sha1:1a8ccb0ffaeda73df855fd3fb70a83e718faa9ec</id>
<content type='text'>
For performance reasons, we track whether a cell is selected or not
using a bit in a cell's attributes.

This makes it easy for the renderer to determine if the cells should
be rendered as selected or not - it just have to look at the
'selected' bit instead of doing a complex range check against the
current selection.

This works nicely in most cases. But, if the cell is updated, the
'selected' bit is cleared. This results in the renderer rendering the
cell normally, i.e. _not_ selected.

Checking for this, and re-setting the 'selected' bit when the cell is
updated (printed to) is way too expensive as it is in the hot path.

Instead, sync the 'selected' bits just before rendering. This isn't so
bad as it may sound; if there is no selection this is a no-op. Even if
there is a selection, only those cells whose 'selected' bit have been
cleared are dirtied (and thus re-rendered) - these cells would have
been re-rendered anyway.
</content>
</entry>
<entry>
<title>selection: on_row_in_view() -&gt; on_rows_in_view(), and now takes a range</title>
<updated>2020-05-16T19:16:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-16T14:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=38c050746dba0b309780862bf90db43d143b2f0a'/>
<id>urn:sha1:38c050746dba0b309780862bf90db43d143b2f0a</id>
<content type='text'>
This allows us to check the selection once when scrolling, instead of
once for each scrolled in line.
</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>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>
</feed>
