<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/grid.h, branch 1.7.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-02-26T08:15:45Z</updated>
<entry>
<title>grid: add grid_snapshot()</title>
<updated>2021-02-26T08:15:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-22T09:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ae3ec52507c85395f90bf7c0ecc5b79affdc9b63'/>
<id>urn:sha1:ae3ec52507c85395f90bf7c0ecc5b79affdc9b63</id>
<content type='text'>
This function deep copies a grid into a newly *allocated* grid struct.
</content>
</entry>
<entry>
<title>grid: add grid_free()</title>
<updated>2021-02-26T08:15:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-22T09:20:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bb74fe3f7de2b2e933eee9b0d36a811efabedb2e'/>
<id>urn:sha1:bb74fe3f7de2b2e933eee9b0d36a811efabedb2e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: add new function grid_row_add_uri_range()</title>
<updated>2021-02-21T19:15:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-14T19:50:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5eea06cff99abbac234d517e84e31576234c7e2e'/>
<id>urn:sha1:5eea06cff99abbac234d517e84e31576234c7e2e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: add new function, grid_row_reset_extra()</title>
<updated>2021-02-21T19:15:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-14T19:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=00977fcc156b322516d50db38f27a8a050820c28'/>
<id>urn:sha1:00977fcc156b322516d50db38f27a8a050820c28</id>
<content type='text'>
This function resets (free:s) all ‘extra’ data associated with a row.
</content>
</entry>
<entry>
<title>debug: rename assert() to xassert(), to avoid clashing with &lt;assert.h&gt;</title>
<updated>2021-01-16T20:16:00Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-16T20:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e56136ce1192d04a52b01ccb41284f0b7896430e'/>
<id>urn:sha1:e56136ce1192d04a52b01ccb41284f0b7896430e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>resize: don’t reflow text on alt screen</title>
<updated>2020-11-25T06:47:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-24T18:00:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9a498038d681e65748b5223d814758a6b7a47693'/>
<id>urn:sha1:9a498038d681e65748b5223d814758a6b7a47693</id>
<content type='text'>
Alt screen applications normally reflow/readjust themselves on a
window resize.

When we do it too, the result is graphical glitches/flashes since our
re-flowed text is rendered in one frame, and the application re-flowed
text soon thereafter.

We can’t avoid rendering some kind of re-flowed frame, since we don’t
know when, or even if, the application will update itself. To avoid
glitches, we need to render, as closely as possible, what the
application itself will render shortly.

This is actually pretty simple; we just need to copy the visible
content over from the old grid to the new grid. We don’t bother with
text re-flow, but simply truncate long lines.

To simplify things, we simply cancel any active selection (since often
times, it will be corrupted anyway when the application redraws
itself).

Since we’re not reflowing text, there’s no need to translate e.g. the
cursor position - we just keep the current position (but bounded to
the new dimensions).

Fun thing: ‘less’ gets corrupted if we don’t leave the cursor at
the (new) bottom row. To handle this, we check if the cursor (before
resize) is at the bottom row, and if so, we move it to the new bottom
row.

Closes #221
</content>
</entry>
<entry>
<title>grid: reflow: calculate width of composed characters correctly</title>
<updated>2020-09-06T17:14:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-06T17:14:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=61f950f77ac52779b5fcf34c628df4caee791af4'/>
<id>urn:sha1:61f950f77ac52779b5fcf34c628df4caee791af4</id>
<content type='text'>
Before this patch, reflow called `wcwidth()` on our magic values for
composed characters.
</content>
</entry>
<entry>
<title>grid: swap_row: remove unused parameter 'initialize'</title>
<updated>2020-05-16T21:43:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-16T21:43:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=57e04a1320f46eece193c3f807c8e058c4f3fb78'/>
<id>urn:sha1:57e04a1320f46eece193c3f807c8e058c4f3fb78</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: make tracking_points array 'const'</title>
<updated>2020-04-17T20:19:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-17T20:17:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5e2e59679b23010a04d04bbe9473dba89bd6dd30'/>
<id>urn:sha1:5e2e59679b23010a04d04bbe9473dba89bd6dd30</id>
<content type='text'>
The elements aren't, and cannot be, const. But the array itself can,
and should be.
</content>
</entry>
<entry>
<title>grid: reflow: caller may now pass a list of coordinates that should be translated</title>
<updated>2020-04-17T19:04:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-17T19:04:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ef52ed8a109af7512bd9e9ed62d74e36ae2deb41'/>
<id>urn:sha1:ef52ed8a109af7512bd9e9ed62d74e36ae2deb41</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: grid_reflow() now translates cursor coordinates</title>
<updated>2020-04-16T17:38:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-16T17:38:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5546b40369b7bc20201a8f3a327be0ff84af7f5a'/>
<id>urn:sha1:5546b40369b7bc20201a8f3a327be0ff84af7f5a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render/grid: move grid reflow code to grid.c</title>
<updated>2020-02-15T21:19:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-15T21:19:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=38a682f0d0114e118e71482ee1cfb89bc846f20d'/>
<id>urn:sha1:38a682f0d0114e118e71482ee1cfb89bc846f20d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: wip: initial search matching</title>
<updated>2019-08-27T17:33:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-27T17:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=aee5045395ca2393b60d962e6e9440a59edbfd6e'/>
<id>urn:sha1:aee5045395ca2393b60d962e6e9440a59edbfd6e</id>
<content type='text'>
* match search buffer against scrollback content
* adjust view to ensure matched content is visible
* create selection on a successful match
* finalize selection when user presses enter (to "commit" the search)
* ctrl+r searches for the next match. Needs more work though.
</content>
</entry>
<entry>
<title>scrolling: optimize row access by assuming number of rows is a power of 2</title>
<updated>2019-08-22T15:33:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-22T15:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7c7720a3ab314e471499194f114797ca7a40afde'/>
<id>urn:sha1:7c7720a3ab314e471499194f114797ca7a40afde</id>
<content type='text'>
With this assumption, we can replace 'a % b' with 'a &amp; (b - 1)'. In
terms of instructions, this means a fast 'and' instead of a slow
'div'.

Further optimize scrolling by:

* not double-initializing empty rows. Previously, grid_row_alloc()
  called calloc(), which was then followed by a memset() when
  scrolling. This is of course unnecessary.

* Don't loop the entire set of visible rows (this was done to ensure
  all visible rows had been allocated, and to prefetch the cell
  contents).

  This isn't necessary; only newly pulled in rows can be NULL. For
  now, don't prefetch at all.
</content>
</entry>
<entry>
<title>grid: prefetch cells in grid_row()</title>
<updated>2019-07-10T17:52:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T17:52:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=decb4503bfb846d039c7048f48c9680fc6e7595b'/>
<id>urn:sha1:decb4503bfb846d039c7048f48c9680fc6e7595b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: repair grid_row_in_view(): use 'view', not 'offset'</title>
<updated>2019-07-10T14:35:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T14:35:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=132749b1ed51ccf540fee42483bbdbb883c3fee8'/>
<id>urn:sha1:132749b1ed51ccf540fee42483bbdbb883c3fee8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: don't pre-allocate the entire grid (with all scrollback lines)</title>
<updated>2019-07-10T14:27:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T14:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ff1b3a71e8edcad62c98a3c80b6e1d8a77bc26f'/>
<id>urn:sha1:1ff1b3a71e8edcad62c98a3c80b6e1d8a77bc26f</id>
<content type='text'>
The row array may now contain NULL pointers. This means the
corresponding row hasn't yet been allocated and initialized.

On a resize, we explicitly allocate the visible rows.

Uninitialized rows are then allocated the first time they are
referenced.
</content>
</entry>
<entry>
<title>grid: don't implement grid_swap_row() in the header file</title>
<updated>2019-07-10T14:08:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T14:08:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f0d574dcb0dc0f94a3e5da13331b8913ec9cd93'/>
<id>urn:sha1:8f0d574dcb0dc0f94a3e5da13331b8913ec9cd93</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wip: initial scroll back support</title>
<updated>2019-07-09T14:26:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-09T14:26:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bcd111d203f9e421b43e4e31fc750b0515b10d61'/>
<id>urn:sha1:bcd111d203f9e421b43e4e31fc750b0515b10d61</id>
<content type='text'>
Can scroll up and down, and stops when the beginning/end of history is
reached.

However, it probably breaks when the entire scrollback buffer has been
filled - we need to detect when the view has wrapped around to the
current terminal offset.

The detection of when we've reached the bottom of the history is also
flawed, and only works when we overshoot the bottom with at least a
page.

Resizing the windows while in a view most likely doesn't work.

The view will not detect a wrapped around scrollback buffer. I.e. if
the user has scrolled back, and is stationary at a view, but there is
still output being produced. Then eventually the scrollback buffer
will wrap around. In this case, the correct thing to do is make the
view start following the beginning of the history. Right now it
doesn't, meaning once the scrollback buffer wraps around, you'll start
seeing command output...
</content>
</entry>
<entry>
<title>wip: grid is now represented as a grid, not a linear array</title>
<updated>2019-07-08T11:57:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-08T11:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4e25019ba6bd1bd07925ccafc2936416ef3f7cbe'/>
<id>urn:sha1:4e25019ba6bd1bd07925ccafc2936416ef3f7cbe</id>
<content type='text'>
The grid is now represented with an array of row *pointers*. Each row
contains an array of cells (the row's columns).

The main point of having row pointers is we can now move rows around
almost for free.

This is useful when scrolling with scroll margins for example, where
we previously had to copy the lines in the margins. Now it's just a
matter of swapping two pointers.
</content>
</entry>
</feed>
