<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/grid.h, 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-15T21:19:08Z</updated>
<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>
<entry>
<title>grid: grid_memset() -&gt; grid_memclear()</title>
<updated>2019-07-07T15:10:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-07T15:10:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=48528419c4660c6ca40a276c4854d946334c0b9b'/>
<id>urn:sha1:48528419c4660c6ca40a276c4854d946334c0b9b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>scrolling: initial reverse scrolling support - no scroll regions</title>
<updated>2019-07-03T08:45:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-03T08:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a7a28ff5816c0f80a439c4ad828c6f0028493b1f'/>
<id>urn:sha1:a7a28ff5816c0f80a439c4ad828c6f0028493b1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: implement a memmove-sort-of function</title>
<updated>2019-07-01T17:18:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-01T17:18:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=482f56b4a2f9a30a57b78188cd3faa5e21bbb588'/>
<id>urn:sha1:482f56b4a2f9a30a57b78188cd3faa5e21bbb588</id>
<content type='text'>
grid_memmove() moves cell data from one index to another, taking the
grid offset into account.
</content>
</entry>
<entry>
<title>wip: use a sliding window instead of memmove() to scroll</title>
<updated>2019-07-01T10:23:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-01T10:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d70956da08c987af639fd8e03e669ca59c4c542b'/>
<id>urn:sha1:d70956da08c987af639fd8e03e669ca59c4c542b</id>
<content type='text'>
Instead of memmoving a large amount of data on every scroll, use a
sliding window. That is, each time we scroll, we offset origin.
</content>
</entry>
<entry>
<title>Rename grid_* functions to term_*</title>
<updated>2019-06-29T19:03:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-29T19:03:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ecd4a6ae14d951090b88a18972d55d81232eabf'/>
<id>urn:sha1:1ecd4a6ae14d951090b88a18972d55d81232eabf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>scroll-region: don't clear damage queue when changing scroll region</title>
<updated>2019-06-25T18:11:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-25T18:11:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a35738d96f251379074a8e79ec2c179afcfe79fa'/>
<id>urn:sha1:a35738d96f251379074a8e79ec2c179afcfe79fa</id>
<content type='text'>
Vim, for example, changes the scroll region every time you scroll a
single line. Thus, resetting the damage queue is slow.

This reworks the damage handling of scroll updates:

* Split damage queue into two: one for scroll operations and one for
  update/erase operations.
* Don't separate update/erase operations inside/outside the scroll
  region
* Store the current scroll region in the scroll damage operation. This
  allows us to stack multiple scroll operations with different scroll
  regions.
* When updating update/erase operations after a scroll operation,
  split the update/erase operations if necessary (the current scroll
  operation may have a scroll region different from before, thus
  forcing us to split existing update/erase operations.
* The renderer no longer erases after a scroll. The scroll operation
  also adds an erase operation. This also means that erase operation
  are subject to adjustments by later scroll operations.
</content>
</entry>
<entry>
<title>scrolling region: wip</title>
<updated>2019-06-23T19:12:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-23T19:12:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2fe7145aff1cf710fc00519a0f72199c3fa0a929'/>
<id>urn:sha1:2fe7145aff1cf710fc00519a0f72199c3fa0a929</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: wip: implement scrolling region</title>
<updated>2019-06-23T16:02:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-23T16:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b0a2c54fe841545d21e79b5bb559cc2dc9d3353f'/>
<id>urn:sha1:b0a2c54fe841545d21e79b5bb559cc2dc9d3353f</id>
<content type='text'>
This is largely untested, but existing scrolling code has been
converted to using a terminal-global scrolling region that is defined
as start-end of the scrollable region.

This is compared to the old code where the scrolling region where
defined in terms of marginals, counted in lines from top and from
bottom.
</content>
</entry>
<entry>
<title>vt: implement reverse scrolling (terminfo 'ri')</title>
<updated>2019-06-23T15:16:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-23T15:16:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fbf0db621cb29804e67af850c1646c3185464dcb'/>
<id>urn:sha1:fbf0db621cb29804e67af850c1646c3185464dcb</id>
<content type='text'>
This currently duplicates the code paths for DAMAGE_SCROLL; there are
many similarities between the two, but also major differences...
</content>
</entry>
<entry>
<title>grid: implement DAMAGE_SCROLL</title>
<updated>2019-06-21T12:29:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-21T12:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a50be28b9d2a4dd0e9b06ccb396a9a77247d60a5'/>
<id>urn:sha1:a50be28b9d2a4dd0e9b06ccb396a9a77247d60a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use a 'damage' list to communicate what needs to be updated</title>
<updated>2019-06-19T12:17:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-19T12:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=304f15d696ad544bbd90a1e54e547e4e2fbe42c5'/>
<id>urn:sha1:304f15d696ad544bbd90a1e54e547e4e2fbe42c5</id>
<content type='text'>
Instead of having each cell in the grid track it's own dirtiness, grid
operations now append "damage" to a list.

This list is consumed every time we render the grid.

This allows us to special case some operations, like erase (and in the
future, scroll).
</content>
</entry>
</feed>
