<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/grid.c, branch 1.6.4</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.4</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.4'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-11-25T19:33:07Z</updated>
<entry>
<title>grid: resize_without_reflow: don’t call min() on every loop iteration</title>
<updated>2020-11-25T19:33:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-25T19:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=434c8e41216e2abb08e51c3241bcd0a0e40a1ce6'/>
<id>urn:sha1:434c8e41216e2abb08e51c3241bcd0a0e40a1ce6</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>sixel: implement reflow</title>
<updated>2020-10-09T05:44:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T11:12:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dbfc636ade8bd59a4a5af4531c19af8a163e8c09'/>
<id>urn:sha1:dbfc636ade8bd59a4a5af4531c19af8a163e8c09</id>
<content type='text'>
Move sixel reflow from grid_reflow() to sixel_reflow(). This lets us
use internal sixel functions to update the sixels.

Note that grid_reflow() still needs to remap the sixelss coordinates.
</content>
</entry>
<entry>
<title>grid: reflow: re-insert sixels *after* new grid offset has been set</title>
<updated>2020-10-09T05:44:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-03T21:00:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=323119a6451445119c8e314e6bd18c19c7db9682'/>
<id>urn:sha1:323119a6451445119c8e314e6bd18c19c7db9682</id>
<content type='text'>
Also make sure to destroy sixels that are too big to fit in the scrollback.

Fixes issues with the sixel list not being sorted correctly.
</content>
</entry>
<entry>
<title>grid: reflow: fix release build; ‘idx’ is only used in an assert()</title>
<updated>2020-09-29T17:40:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-24T16:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1718449ca652a64f091120f921cd7d91477f4f97'/>
<id>urn:sha1:1718449ca652a64f091120f921cd7d91477f4f97</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: handle viewport being too far down when enlarging the window</title>
<updated>2020-09-29T17:40:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-24T16:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8c183042874728848ec1b9d055f2b0cc020b9a28'/>
<id>urn:sha1:8c183042874728848ec1b9d055f2b0cc020b9a28</id>
<content type='text'>
If the viewport is close to the bottom, but not *at* the bottom, and
we’re enlarging the window, the translated viewport will be too far
down.
</content>
</entry>
<entry>
<title>grid: reflow: retain scrollback position</title>
<updated>2020-09-29T17:40:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-24T16:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a0d1d2f1c8c9a14125ff33c5bc46e8fc8ca62356'/>
<id>urn:sha1:a0d1d2f1c8c9a14125ff33c5bc46e8fc8ca62356</id>
<content type='text'>
Closes #142
</content>
</entry>
<entry>
<title>grid: reflow: make sure cursor is within the visible screen area</title>
<updated>2020-09-10T05:37:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-09-09T16:40:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a1ab31eea563dc4bee81bddd8d99a861712f6230'/>
<id>urn:sha1:a1ab31eea563dc4bee81bddd8d99a861712f6230</id>
<content type='text'>
Even though we translate the cursor position from the old grid
coordinates to the new, the cursor may _still_ end up outside the
visible area.

Make sure it doesn’t.
</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>Convert most dynamic allocations to use functions from xmalloc.h</title>
<updated>2020-08-08T19:37:57Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-08T19:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a77958ba20c2b344be5e66e69e2f212a4bbf6b3'/>
<id>urn:sha1:7a77958ba20c2b344be5e66e69e2f212a4bbf6b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: don't insert &lt;width&gt; spacer cells for *every* empty cell</title>
<updated>2020-08-04T16:07:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-04T16:07:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c07d14e1c095ac36b4a85ce5bc88f6ba15a4ad8d'/>
<id>urn:sha1:c07d14e1c095ac36b4a85ce5bc88f6ba15a4ad8d</id>
<content type='text'>
Only do it for the last, non-empty cell.
</content>
</entry>
<entry>
<title>grid: reflow: use macro print_spacer() to insert multi-column character spacers</title>
<updated>2020-07-14T18:29:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T18:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b0798ad0bed7dac45c167040644df6599cc390f0'/>
<id>urn:sha1:b0798ad0bed7dac45c167040644df6599cc390f0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: handle multi column character spacers</title>
<updated>2020-07-14T15:04:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T15:04:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9ea42ef226cdc92c09470a522516a2209b986281'/>
<id>urn:sha1:9ea42ef226cdc92c09470a522516a2209b986281</id>
<content type='text'>
Ignore *old* cells containing spacers.

Pad new grid with spacers if a multi-column character doesn't fit at
the end of a line.

Insert spacers after a multi-column character.
</content>
</entry>
<entry>
<title>grid: reflow: always emit *all* cells of a multi-column character</title>
<updated>2020-07-14T10:15:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T10:15:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3fd61fa1203c9061394952a5efdc864b37d64cff'/>
<id>urn:sha1:3fd61fa1203c9061394952a5efdc864b37d64cff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: use width=1 for invalid characters</title>
<updated>2020-07-14T10:03:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T10:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=466466c19e6d4ddf6a90e6fb7f498225890cef4d'/>
<id>urn:sha1:466466c19e6d4ddf6a90e6fb7f498225890cef4d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: reflow: force line-wrap if a multi-column character does not fit on current line</title>
<updated>2020-07-14T09:03:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T09:03:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=803c87bb6565f09a60e4fa01c71bc1d43b4ebecd'/>
<id>urn:sha1:803c87bb6565f09a60e4fa01c71bc1d43b4ebecd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>reflow: ensure sixels are correctly sorted when re-inserted</title>
<updated>2020-06-29T19:59:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-29T19:59:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a136987678afcaa7b8ad22456a0632ee8a743943'/>
<id>urn:sha1:a136987678afcaa7b8ad22456a0632ee8a743943</id>
<content type='text'>
And make sure to remove re-inserted sixels that has wrapped around the
scrollback (this may happen when the window size decreases).
</content>
</entry>
<entry>
<title>grid: reflow: delete sixels that end up crossing the scrollback wrap around</title>
<updated>2020-06-27T18:16:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-27T18:16:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=deb61d20d82bdfc45af2aa51786fa500e53b84bb'/>
<id>urn:sha1:deb61d20d82bdfc45af2aa51786fa500e53b84bb</id>
<content type='text'>
Our sixel handling code requires sixels to *not* cross the scrollback
wrap around.

Until we've fixes the reflow code that split up such sixels (much like
we do when we generate a sixel), simply delete it.
</content>
</entry>
<entry>
<title>grid: add TODO, and an assert, that sixels must not cross wrap-around</title>
<updated>2020-06-27T13:34:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-27T13:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=644c8ef879cfae9666cce87f83936a38dad1d34d'/>
<id>urn:sha1:644c8ef879cfae9666cce87f83936a38dad1d34d</id>
<content type='text'>
</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>
</feed>
