| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.
When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.
When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is >= COMB_CHARS_LO).
Then we render the grapheme pretty much like before.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We only used utf8proc to try to pre-compose a glyph from a base and
combining character.
We can do this ourselves by using a pre-compiled table of valid
pre-compositions. This table isn't _that_ big, and binary searching it
is fast.
That is, for a very small amount of code, and not too much extra RO
data, we can get rid of the utf8proc dependency.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function extends an existing selection in the following way:
If the extension point is *before* the upper boundary of the current
selection, extend the selection upwards.
If the extension point is *after* the bottom boundary of the current
selection, extend the selection downwards.
If the extension point is *inside* the current selection, shrink the
selection such that the new size is maximized. This means we move the
*closest* start/end point from in the current selection.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To do text reflow, we only need to know if a line has been explicitly
linebreaked or not. If not, that means it wrapped, and that we
should *not* insert a linebreak when reflowing text.
When reflowing text, when reaching the end of a row in the old grid,
only insert a linebreak in the new grid if the old row had been
explicitly linebreaked.
Furthermore, when reflowing text and wrapping a row in the new grid,
mark the previous row as linebreaked if either the last cell was
(the last column in the last row) empty, or the current cell (the
first column in the new row) is empty. If both are non-empty, then we
assume a linewrap.
|
| |
|
|
|
| |
Insert a newline into the selection even if the last column contained
a printable character, *if* that column also has linefeed=1.
|
| |
|
|
| |
This reverts commit 5bac3cfa2cb6a1e7b6eb0012c134bd2e844fcf61.
|
| | |
|
| |
|
|
|
|
| |
This fixes an issue where a "forced" selection (shift being pressed
while slave is tracking mouse events) would not finalize if the user
released shift *before* releasing the mouse button.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously when updating a selection, we would unmark *all* cells in
the old selection, and then mark all cells in the new selection.
This caused *all* cells to be dirtied and thus re-rendered.
Avoid this, by adding a temporary state to the cells' selected state.
Before unmarking the old selection, pre-mark the new selection using a
temporary state.
When unmarking the old selection, ignore cells in this temporary state.
When marking the new selection, ignore cells in this temporary
state (except clearing the temporary state).
|
| |
|
|
|
| |
Fixes occasional crashes when we're at the end of the grid and
selection wraps around.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
When we extract text, we may insert '\n' at the end of each line (or
last column of selection, for block selections).
These newlines doesn't occupy any physical cells, and thus we
must **make** room for them in the extraction buffer.
|
| |
|
|
|
|
|
|
|
|
| |
When extracting text from the selection, we lost the first column on
all rows but the first.
This is because the algorithm changed slightly when we moved to
foreach_selection(); the end-of-line detection is now done on the
first column of the new line, instead of the last column on the
previous line.
|
| |
|
|
|
| |
Instead of converting a cell at a time to UTF-8, copy the wide
characters as is, and then convert everything at once at the end.
|
| |
|
|
|
| |
This "automagically" adds support for block selections, since
foreach_selected already handles block selections.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Instead of having the renderer calculate, for each cell, whether that
cell is currently selected or not, make selection_update() mark/unmark
the selected cells.
The renderer now only has to look at the cells' 'selected'
attribute. This makes the renderer both smaller and faster.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Instead of first memmoving, possibly lots of data lots of times, the
received buffer, and _then_ calling the callback, simply call the
callback multiple times, and just skip the \r character(s).
|
| | |
|
| |
|
|
|
|
| |
When this returns true, it means we have keyboard focus and are
grabbing the mouse (for e.g. selections), regardless of whether the
client has enabled mouse tracking or not.
|
| |
|
|
|
|
|
|
|
|
| |
Up the requirements for enabling "forced" selection (that is, allowing
selections even though mouse tracking has been disabled).
* Require keyboard focus (if we don't have it, then the shift-key
isn't is for us)
* Don't just require shift being pressed, but that all other modifiers
are *not* pressed.
|
| |
|
|
|
|
|
|
|
| |
When trying to write (to e.g. the slave, or to a clipboard receiver),
we first try to send the data synchronously, and only if that fails do
we switch to asynchronous mode.
However, the first synchronous may (in fact, is likely to) succeed
partially.
|
| | |
|
| |
|
|
|
| |
When there's no selection, exit early to avoid trying to get grid data
from row -1.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This callback is *always* called, including when there has been an
error.
This is in preparation for making text_from_{clipboard,primary}
asynchronous.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Only if we fail to write everything do we switch to asynchronous mode.
|
| |
|
|
| |
TODO: try writing synchronously first
|
| | |
|
| |
|
|
|
|
| |
We do however need access to it, so provide a pointer. The difference
is that now we can have a *single* wayland instance, but multiple
terminal instances.
|
| |
|
|
|
| |
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
|
| | |
|
| |
|
|
| |
These are application global and very wayland specific
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
If we scroll enough, we'll eventually end up wrapping around the
entire scrollback buffer. At this point, a selection is no longer
valid, so cancel it.
Note: this was very obvious when scrolling in the alt screen, since
its scrollback buffer is what you see on the screen (i.e. it has no
scrollback).
|
| |
|
|
|
| |
When the selection is finalized, swap start/end if necessary, to make
sure start <= end.
|
| |
|
|
|
| |
When the user double-clicks with ctrl pressed, we now select the word
under the cursor using spaces only as word separator.
|
| |
|
|
|
| |
This allows us to select text in e.g. man/less while still being able
to use LESS=--MOUSE (i.e. enable scrolling with mouse).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
The 'attributes' struct is now 8 bytes and naturally packed (used to
be 9 bytes, artificially packed).
'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes,
artificially packed).
Furthermore, the glyph is stored as a wchar instead of a char*. This
makes it easier (faster) to do glyph lookup when rendering.
|
| |
|
|
|
|
| |
When "auto-selecting" a word, we used to only break on space
characters. Now we break on a number of other characters as
well.
|
| | |
|
| |
|
|
|
| |
This function reads data from the clipboard, and calls a user-provided
callback for each chunk of clipboard data.
|
| |
|
|
| |
This function takes a string and makes it available to the clipboard.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|