We don’t write anything more to the buffer after this, but this makes
this code consistent with all other code that pushes new data to the
buffer.
This makes it easier to search, and validate, the
ensure_size()+push-data pattern.
‘idx’ is where _new_ data should be pushed into the buffer. Thus it is
perfectly valid for it to be equal to ‘size’ - it just means we need
to allocate more space before pushing data to it.
This fixes an assertion triggered when selecting the upper left cell
and dragging down.
We would end up trying to decrement the pivot end point, hitting an
assertion that only is valid while skipping spacers.
Remove the assertion, and allow pivot points to be moved across line
wraps, but take care not to move outside the visible screen area.
If the initial character is a space, find the next non-space
character.
If the initial character is a delimiter, find the next non-delimiter
character (space, or word character).
If the initial character is neither (i.e, it is a word character),
find the next non-word character.
Extend selection pivoting to allow selections to pivot around a
range.
Use this in word- and row-based selections to pivot around the initial
word/row that was selected.
This mimics the behavior of at least urxvt and xterm.
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}
When tweak.allow-overflowing-double-width-glyphs=yes, then certain
glyphs are allowed to overflow into the neighbouring cell.
However, if the cell “owning” the double-width glyph is erased (_only_
that cell), then the cell overflowed into is not redrawn, causing
part of the double-width glyph to remain on screen.
To avoid checking for these glyphs when printing to the terminal (i.e
at parse time), simply mark both cells as dirty when we render the
overflowing glyph.
Yes, this means that the cells will always be re-rendered. We count on
them only making up a small portion of the screen.
“The optimize attribute should be used for debugging purposes
only. It is not suitable in production code.”
Luckily, it seems it really isn’t needed anymore; with all the other
size optimizations that has been done since this was introduced, there
is no longer any difference with or without this pragma.
Mixed here refers to mixed thickness - the lines thickness doesn’t
match the thickness of an abstract, orthogonal line going through the
middle of the cell.
When mirroring an arc, we need to adjust the mirrored position if the
arc’s position in the cell is asymmetrical. This happens when *either*
the line is odd sized, *or* the cell is. But not when both are.
Thus, we can simply do a ‘thickness % 2 ^ width % 2’ when adjusting
the position.
Describe this in a comment.