<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/grid.c, branch 1.12.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.12.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.12.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-04-25T17:57:18Z</updated>
<entry>
<title>grid: add abs-to-sb and sb-to-abs utility function</title>
<updated>2022-04-25T17:57:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-25T17:57:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b4f666118febfc95bf97e31aa1e39e3df9522dfa'/>
<id>urn:sha1:b4f666118febfc95bf97e31aa1e39e3df9522dfa</id>
<content type='text'>
These functions convert row numbers between absolute coordinates and
“scrollback relative” coordinates.

Absolute row numbers can be used to index into the grid-&gt;rows[] array.

Scrollback relative numbers are ordered with the *oldest* row first,
and the *newest* row last. That is, in these coordinates, row 0 is the
*first* (oldest) row in the scrollback history, and row N is the
*last* (newest) row.

Scrollback relative numbers are used when we need to sort things after
their age, when determining if something has scrolled out, or when
limiting an operation to ensure we don’t go past the scrollback
wrap-around.
</content>
</entry>
<entry>
<title>grid: reflow: add TODO to detect selection on re-used rows, and cancel it</title>
<updated>2022-02-07T14:06:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-07T12:57:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0800515c04ba52b5b31c43d326bd590fe6cb5954'/>
<id>urn:sha1:0800515c04ba52b5b31c43d326bd590fe6cb5954</id>
<content type='text'>
</content>
</entry>
<entry>
<title>replace gettimeofday with clock_gettime</title>
<updated>2022-01-15T16:05:45Z</updated>
<author>
<name>Pranjal Kole</name>
<email>pranjal.kole7@gmail.com</email>
</author>
<published>2022-01-15T09:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0da19a81bc9a94f83bfcf8c5af0e3571f751cf38'/>
<id>urn:sha1:0da19a81bc9a94f83bfcf8c5af0e3571f751cf38</id>
<content type='text'>
POSIX.1-2008 has marked gettimeofday(2) as obsolete, recommending the
use of clock_gettime(2) instead.

CLOCK_MONOTONIC has been used instead of CLOCK_REALTIME because it is
unaffected by manual changes in the system clock. This makes it better
for our purposes, namely, measuring the difference between two points in
time.

tv_sec has been casted to long in most places since POSIX does not
define the actual type of time_t.
</content>
</entry>
<entry>
<title>grid: reload pointers into the uri range vector after inserting</title>
<updated>2021-12-08T16:41:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-08T16:41:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2e8c9c2fe5bc393c1f7d931b78ab671cef91b277'/>
<id>urn:sha1:2e8c9c2fe5bc393c1f7d931b78ab671cef91b277</id>
<content type='text'>
Inserting elements into the URI range vector typically triggers a
vector resize. This is done using realloc(). Sometimes this causes the
vector to move, thus invalidating all existing pointers into the
vector.
</content>
</entry>
<entry>
<title>grid: uri_range_erase(): unittest: try erasing a row without any URIs</title>
<updated>2021-11-28T10:05:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-28T10:05:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2fe2dfa847a2fdc3563d53a1a1a81e1853868c4f'/>
<id>urn:sha1:2fe2dfa847a2fdc3563d53a1a1a81e1853868c4f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: uri_range_erase: walk the ranges backwards</title>
<updated>2021-11-28T10:03:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-28T09:56:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=66b8c92c30667327ce7b5de3cbc068be67b3719a'/>
<id>urn:sha1:66b8c92c30667327ce7b5de3cbc068be67b3719a</id>
<content type='text'>
This way, ranges are deleted last-to-first, thus avoiding memmoving
multiple ranges over and over again when erasing e.g. a full line.
</content>
</entry>
<entry>
<title>grid: remove useless assertion</title>
<updated>2021-11-27T17:15:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-27T17:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=747da83c765d8df4c369d3a9bf82ea87ce9f1284'/>
<id>urn:sha1:747da83c765d8df4c369d3a9bf82ea87ce9f1284</id>
<content type='text'>
  grid.c:1041:24: warning: comparison of unsigned expression in ‘&gt;= 0’ is always true [-Wtype-limits]
</content>
</entry>
<entry>
<title>grid: resize without reflowing: use URI range utility functions</title>
<updated>2021-11-27T15:31:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-27T15:31:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ce6c89df638bb7bff5552997f671092cd32a858'/>
<id>urn:sha1:5ce6c89df638bb7bff5552997f671092cd32a858</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: uri_range_{append,insert}: pass range attributes as separate parameters</title>
<updated>2021-11-27T15:25:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-27T15:24:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dfeca4e13497f9a4295cb4c23e53e7639d614e45'/>
<id>urn:sha1:dfeca4e13497f9a4295cb4c23e53e7639d614e45</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: snapshot: use uri range utility functions</title>
<updated>2021-11-27T15:11:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-27T15:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5c6c2de0517fbe93b748d3315b7b52ca682bac24'/>
<id>urn:sha1:5c6c2de0517fbe93b748d3315b7b52ca682bac24</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: uri_range_ensure_size(): add the requested amount of entries</title>
<updated>2021-11-27T15:03:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-27T15:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5c7e881cd49d7814c7f791f5e3457aca2b5f72d3'/>
<id>urn:sha1:5c7e881cd49d7814c7f791f5e3457aca2b5f72d3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: no need to keep a uri-range-idx variable</title>
<updated>2021-11-26T19:57:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-26T19:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=76992713161b589407060c2fc7a42e7ffb192844'/>
<id>urn:sha1:76992713161b589407060c2fc7a42e7ffb192844</id>
<content type='text'>
The URI ranges are now an array, which means we can get the next URI
range by incrementing the pointer.

Instead of checking if range is not NULL, check that it isn’t the
range terminator (which is NULL when we don’t have any ranges, and
the first address *after* the last range otherwise).
</content>
</entry>
<entry>
<title>grid: resize without reflow: only verify URI ranges in debug builds</title>
<updated>2021-11-26T19:36:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-26T19:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=41565a0d0ef4486b8b0a223fc8cc28180022cb52'/>
<id>urn:sha1:41565a0d0ef4486b8b0a223fc8cc28180022cb52</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: bug: OSC-8 URIs were incorrectly skipped while resizing the alt screen</title>
<updated>2021-11-26T19:29:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-26T19:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=be203aeae1280ad7cac3ec9e287d1dd97528f390'/>
<id>urn:sha1:be203aeae1280ad7cac3ec9e287d1dd97528f390</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc8: replace grid_row_uri_range_add() with internal uri_range_append()</title>
<updated>2021-11-26T19:25:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-26T19:25:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4eb0aa0f185ea9da604582bf8f091ab428b27997'/>
<id>urn:sha1:4eb0aa0f185ea9da604582bf8f091ab428b27997</id>
<content type='text'>
grid_row_uri_range_add() was only used while reflowing. In this case,
we know the new URIs being added are always going at the end of the
URI list (since we’re going top-to-bottom, left-to-right).

Thus, we don’t need the insertion logic, and can simply append instead.
</content>
</entry>
<entry>
<title>osc8: uri ranges: use a dynamically re-sizable array instead of a tllist</title>
<updated>2021-11-26T19:09:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-26T18:55:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccee08a393f4c55994e921b43a16f5942816d764'/>
<id>urn:sha1:ccee08a393f4c55994e921b43a16f5942816d764</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc8: update URI ranges as we print data, *not* when the URI is closed</title>
<updated>2021-11-25T18:31:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-25T18:22:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8c50a7afd401686f645fb26676fbcaedb8d4ab62'/>
<id>urn:sha1:8c50a7afd401686f645fb26676fbcaedb8d4ab62</id>
<content type='text'>
At first, an OSC-8 URI range was added when we received the closing
OSC-8 escape (i.e. with an empty URI).

But, this meant that cursor movements while the OSC-8 escape was in
effect wasn’t handled correctly, since we’d add a range that spanned
the cursor movements.

Attempts were made to handle this in the cursor movement functions, by
closing and re-opening the URI.

However, there are too many corner cases to make this a viable
approach. Scrolling is one such example, line-wrapping another.

This patch takes a different approach; emit, or update the URI range
when we print to the grid. This models the intended behavior much more
closely, where an active OSC-8 URI act like any other SGR attribute -
it is applied to all cells printed to, but otherwise have no effect.

To avoid killing performance, this is only done in the “generic”
printer. This means OSC-8 open/close calls must now “switch” the ASCII
printer.

Note that the “fast” printer still needs to *erase* pre-existing OSC-8
URIs.

Closes #816
</content>
</entry>
<entry>
<title>grid: refactor grid_row_uri_range_erase()</title>
<updated>2021-11-21T17:09:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-20T14:46:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f27ccd999ef6fcf10f99aed9f6aec449fe071551'/>
<id>urn:sha1:f27ccd999ef6fcf10f99aed9f6aec449fe071551</id>
<content type='text'>
The old algorithm always created a new URI, followed by (maybe)
removing the existing URI, when an URI needed to be modified.

That is, if e.g. the tail of an URI was being erased, the old
algorithm would create a new URI for the part of the URI that should
remain, and then removed the old URI.

This isn’t very effective. The new algorithm instead identifies all
possible overlap cases, and handles each one differently:

* URI ends *before* erase range starts - continue with the next URI
  without further checks
* URI starts *after* the erase range ends - return, we’re done
* Erase range erases the entire URI - remove the URI
* Erase range erases a part in the middle - split the URI
* Erase range erases the head of the URI - adjust the URI’s start
* Erase range erases the tail of the URI - adjust the URI’s end
</content>
</entry>
<entry>
<title>grid: row_uri_range_erase(): assume caller has checked row-&gt;extra != NULL</title>
<updated>2021-11-21T17:09:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-20T13:40:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=503c2ebd50caaf1d50b57c42d319973277a583e0'/>
<id>urn:sha1:503c2ebd50caaf1d50b57c42d319973277a583e0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: add grid_row_uri_range_erase()</title>
<updated>2021-11-21T17:09:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-20T12:42:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a0de0017f7b2061bad0b695a98963ca0f274e21'/>
<id>urn:sha1:1a0de0017f7b2061bad0b695a98963ca0f274e21</id>
<content type='text'>
This function handles erasing of an URI range. That is, a range of the
row is being either erased, or overwritten (from the URI perspective,
these two are the same thing).

We handle both partial overwrites (split up, or truncate URI), as well
as complete overwrites (remove URI).
</content>
</entry>
</feed>
