aboutsummaryrefslogtreecommitdiff
path: root/selection.c (follow)
Commit message (Collapse)AuthorAgeLines
* selection: don’t replace \r\n and \n with \r in bracketed paste modeDaniel Eklöf2021-01-27-3/+14
|
* selection: no xassert() in the releases/1.6 branchDaniel Eklöf2021-01-26-1/+1
|
* selection: remove duplicate ‘ESC’ in switch caseDaniel Eklöf2021-01-26-4/+0
|
* selection: DEL is 0x7f, not 0x1fDaniel Eklöf2021-01-26-1/+1
|
* selection: codespell: stript -> stripDaniel Eklöf2021-01-26-1/+1
|
* selection: strip non-formatting C0, BS, HT and DEL from pasted textDaniel Eklöf2021-01-26-0/+17
|
* selection: unbreak text/uri-list decoding: we’re not using \r, not \nDaniel Eklöf2021-01-26-1/+1
| | | | | | | | Before passing the pasted text to the decoder, we now replace \r\n, and \n, with \r. The URI decoder was looking for a \n, which meant we failed to split up the list and instead pasted a single “multi-line” URI.
* selection: replace \r\n and \n with \r, and strip \e from pasted textDaniel Eklöf2021-01-26-3/+27
| | | | | Closes #305 Closes #306
* selection: uri decode: move zero-length check into decode_one_uri()Daniel Eklöf2021-01-21-2/+4
|
* selection: add a ‘finish’ function, called at the end of receiving clipboard dataDaniel Eklöf2021-01-21-0/+24
| | | | | This is necessary to decode the final URI in a text/uri-list offer if it hasn’t been newline terminated.
* selection: URI decoder: break out decoding of a single URIDaniel Eklöf2021-01-21-27/+29
|
* input: rework mouse button/motion handlingDaniel Eklöf2020-12-12-0/+2
| | | | | | | | | | | | | | | | | | | Store a list of currently pressed buttons, and which surface they belong to (i.e. which surface that received the press). Then, in motion events (with a button pressed, aka drag operations), send the event to the “original” surface (that received the press). Also send release events to the originating surface. This means a surface receiving a press will always receive a corresponding release. And no one will receive a release event without a corresponding press event. Motion events with a button pressed will *always* use the *first* button that was pressed. I.e. if you press a button, start dragging, and then press another button, we keep generating motion events for the *first* button.
* selection: do not try to paste un-handled mime typesDaniel Eklöf2020-11-30-2/+6
| | | | Closes #230
* selection: offer clipboard content in more mime typesDaniel Eklöf2020-11-30-0/+10
|
* selection: fix enum typeDaniel Eklöf2020-11-06-1/+1
| | | | | | | | enum selection_scroll_direction is used when extending a selection by auto-scrolling the terminal content while the mouse is outside the grid. What we want is enum selection_direction.
* selection: explicitly set direction when right-click extendingDaniel Eklöf2020-11-04-0/+6
| | | | | | | Fixes an issue where right-click-and-dragging to extend a selection caused one cell being removed from the selection. Closes #180
* selection: do mime-type based decoding before passing data to callbackDaniel Eklöf2020-11-01-119/+104
| | | | | | | | | | The intention here is to make *all* text_from_clipboard() and text_from_primary() callers benefit from mime-type base decoding (e.g. URI list decoding). Previously, the decoding was done *in* the callback, which meant only the “default” clipboard/primary selection paste functions, and DnD, recognized URI lists.
* selection: dnd: fix wl_data_offer_destroy() raceDaniel Eklöf2020-10-31-0/+5
| | | | | | | | | | | | | | | | | | | | | At the end of a drag-and-drop operation, we need to call `wl_data_offer_finish()`. We *must* ensure the data offer hasn’t been destroyed before that. This could previously happen if the compositor decided to send a regular clipboard offer *after* we had started a drop operation, but *before* it had finished. The dnd offer was then destroyed when the clipboard offer was received, causing us to crash in `wl_data_offer_finish()`. To handle this, let the receive_offer_context take over ownership of the data_offer pointer, and “manually” destroy it *after* calling `wl_data_offer_finish()` in `receive_dnd_done()`. Note: we should not, and can not, do the same thing for regular clipboard and primary selection offers; such offers can be used multiple times and should *not* be destroyed after a single copy operation.
* codespell: fix misspelled wordsDaniel Eklöf2020-10-28-2/+2
|
* selection: add support for different mime-typesDaniel Eklöf2020-10-28-83/+315
| | | | | | Add support for `text/plain`, `text/plain;charset=utf-8` and `text/uri-list` to regular copy operations (both from clipboard and primary selection) and drag-and-drop operations.
* selection: debug log of data offer mime-types and actionsDaniel Eklöf2020-10-26-5/+5
|
* selection: implement support for drag-and-dropDaniel Eklöf2020-10-26-5/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | We accept COPY and MOVE actions, for text/plain;charset=utf-8 mime-types. To implement DnD, we need to track the current DnD data offer *and* the terminal instance it is (currently) targeting. To do this, a seat has a new member, ‘dnd_term’. On a DnD enter event, we lookup the corresponding terminal instance and point ‘dnd_term’ to it. On a DnD leave event, ‘dnd_term’ is reset. The DnD data offer is tracked in the terminal’s wayland window instance. It is reset, along with the seat’s ‘dnd_term’ on a DnD leave event. On a drop event, we immediately clear the seat’s ‘dnd_term’, to ensure we don’t reset it, or destroy the offer before the drop has been completed. The drop’s ‘done()’ callback takes care of destroying and resetting the DnD offer in the terminal’s wayland window instance. Closes #175
* selection: re-factor: break out code shared between clipboard/primary sendDaniel Eklöf2020-10-13-59/+21
| | | | | The send functions are called by the compositor when another application wants to paste data *from* foot.
* selection: auto-scroll: call cmd_scrollback_{up,down}() with number of rowsDaniel Eklöf2020-10-11-4/+2
| | | | | No need to loop and call cmd_scrollback_{up,down}() with ‘1’ each loop iteration; just call it with the total number of lines to scroll.
* selection: cancel: call selection_stop_scroll_timer()Daniel Eklöf2020-10-11-4/+1
| | | | | Instead of re-implementing the same logic, simply call selection_stop_scroll_timer().
* selection: auto-scroll: add SELECTION_SCROLL_NOT as a scroll ‘direction’Daniel Eklöf2020-10-11-2/+9
|
* selection: auto-scroll: selection keeps scrolling while mouse is outside gridDaniel Eklöf2020-10-11-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving the mouse outside the grid while we have an on-going selection now starts a timer. The interval of this timer depends on the mouse’s distance from the grid - the further away the mouse is, the shorter interval. On each timer timeout, we scroll one line, and update the selection. Thus, the shorter the interval, the faster we scroll. The timer is canceled as soon as the mouse enters the grid again, or the selection is either canceled or finalized. The timer FD is created and destroyed on-demand. Most of the logic is now in selection.c. The exception is the calculation of the timer interval, which depends on the mouse’s position. Thus, this is done in input.c. The scroll+selection update logic needs to know a) which direction we’re scrolling in, and b) which *column* the selection should be updated with. If the mouse is outside the grid’s left or right margins, the stored mouse column will be -1. I.e. we don’t know whether the mouse is on the left or right side of the grid. This is why the caller, that starts the timer, must provide this value. The same applies to top and bottom margins, but since we already have the scroll *direction*, which row value to use can be derived from this.
* selection: use appropriate check for PRIMARY pasteSergey Nazaryev2020-10-10-2/+2
| | | | | | Assume it could be a copy-paste typo. We should check PRIMARY, not CLIPBOARD. Without this fix, we can't use PRIMARY until we copy anything to CLIPBOARD.
* config: add ‘[default].word-delimiters’Daniel Eklöf2020-10-09-4/+5
| | | | | | | | | | This option lets the user configure which characters act as word delimiters when selecting text. This affects both “double clicking”, and ‘ctrl-w’ in scrollback search mode. Closes #156
* selection: reset clipboard/primary->text after free:ing itDaniel Eklöf2020-09-17-0/+2
|
* selection: primary unset: don’t free text twiceDaniel Eklöf2020-09-17-1/+0
|
* selection: add selection_<type>_has_data()Daniel Eklöf2020-09-09-0/+12
| | | | | Returns true when there is data available for paste in the clipboard/primary selection.
* selection: add selection_<type>_unset()Daniel Eklöf2020-09-09-0/+41
| | | | These functions clear the current selection.
* codespell: selection: faild -> failedDaniel Eklöf2020-08-27-1/+1
|
* selection: don't initiate a paste when we're already pastingDaniel Eklöf2020-08-25-0/+10
|
* selection: must use term_paste_data_to_slave() for paste dataDaniel Eklöf2020-08-25-1/+1
|
* selection: clipboard callback: assert we're in sending-paste-data modeDaniel Eklöf2020-08-25-0/+1
|
* selection: block non-paste data from being sent to client while pastingDaniel Eklöf2020-08-25-3/+12
| | | | | | | | | | While pasting data from the clipboard, block *all* other data from being sent to the client. This includes keyboard and mouse events, but also replies for VT queries. This is particularly important when bracketed paste has been enabled, since then the client will interpret *everything* between the bracketed paste start and end as paste data.
* selection: add a 2 second timeout when receiving clipboard dataDaniel Eklöf2020-08-25-11/+78
| | | | | | | | When reading clipboard data, a malicious clipboard provider could stall us forever, by not sending any data, and not closing the pipe. This commit adds a timer_fd based timeout of 2 seconds. If the timer triggers, we abort the clipboard receive.
* selection: don't do "return function_returning_void()" in functions returning voidDaniel Eklöf2020-08-23-11/+22
|
* don't use empty struct initializersDaniel Eklöf2020-08-23-3/+3
|
* selection: don't highlight trailing empty cells in a selectionDaniel Eklöf2020-08-18-11/+55
| | | | | This makes it clear which cells contain spaces (that will be copied) or are empty (will *not* be copied).
* selection: extend: set ongoing to trueDaniel Eklöf2020-08-14-0/+2
|
* selection: finalize: clear ongoing selectionDaniel Eklöf2020-08-14-3/+3
| | | | | | | | | | Check for ongoing selection, and *clear* it before bailing out due to the selection not having an end-point. This fixes an issue where a selection was kept as ongoing, even though the button had been released. Typically triggered by clicking without moving the mouse; this started a new selection, then (tried to) finalize it, but failed since the selection didn't have an end-point.
* selection: update: don't update if there's no ongoing selectionDaniel Eklöf2020-08-14-0/+3
|
* config: add mouse specific bind actionsDaniel Eklöf2020-08-14-0/+7
| | | | | | | | | | | | | | | | | | | | This extends the "normal" bind action enum with mouse specific actions. When parsing key bindings, we only check up to the last valid keyboard binding, while mouse bindings support *both* key actions and mouse actions. The new actions are: * select-begin: starts an interactive selection * select-extend: interactively extend an existing selection * select-word: select word under cursor * select-word-whitespace: select word under cursor, where the only word separating characters are whitespace characters. The old hard-coded selection "bindings" have been converted to instead use these actions, via default bindings added to the configuration.
* selection: improve handling of multi-column charactersDaniel Eklöf2020-08-13-13/+14
| | | | | * Don't assume multi-column characters are exactly *two* columns * Check for CELL_MULT_COL_SPACER values instead of using wcwidth()
* selection: handle multi-column characters when reversing selection directionDaniel Eklöf2020-08-13-16/+30
|
* selection: adjust start point when the selection changes directionDaniel Eklöf2020-08-12-0/+37
| | | | | | | | | Without this, the initial cell will always be selected, regardless of how the selection is moved to the left or right. With this patch, the initial cell will only be selected while the selection is being made in the original direction. Changing direction of the selection moves the start point to next/previous character.
* Convert most dynamic allocations to use functions from xmalloc.hCraig Barnes2020-08-08-5/+6
|
* config: add 'pipe-selected' key bindingDaniel Eklöf2020-07-31-4/+7
| | | | | | | This works just like pipe-visible and pipe-scrollback, but pipes the user-selected text, if any, to the external tool. Closes #51
* Merge branch 'master' into scrollback-position-indicatorDaniel Eklöf2020-07-27-8/+8
|\
| * selection: extending a selection is now interactiveDaniel Eklöf2020-07-27-8/+8
| | | | | | | | | | That is, a selection extension can be resized just like an ordinary extension.
* | input: margins are not selectableDaniel Eklöf2020-07-26-3/+4
|/ | | | | | | | | | | | | * Fix col/row calculation in pointer-enter event; we did not take the margins into account. * seat->mouse.col,row are now set to -1 if the cursor is inside the margins. That is, col/row are only ever valid when the mouse is actually over the grid, and not in the margins. * Use regular 'left-ptr' mouse cursor when mouse is inside the margins, to not make the user think he/she can start a selection. Besides making things clearer, this also fixes a crash that occurred if you started a selection in e.g. the right margin.
* selection: provide a const-wrapper for extract_one()Daniel Eklöf2020-07-15-1/+9
| | | | | extract_one() takes const pointers, while the callback argument to foreach() expects non-const.
* selection: refactor: break out text extraction to a separate fileDaniel Eklöf2020-07-15-170/+22
|
* selection: don't skip SPACER cells in the generic foreach()Daniel Eklöf2020-07-15-4/+3
| | | | | | | | As that breaks e.g. selection marking (SPACER cells didn't get inverted when rendered). Instead, skip them in extract_one() only. I.e. when copying text from the grid.
* selection: row->dirty is a booleanDaniel Eklöf2020-07-15-2/+3
|
* selection: no need to try to detect multi-column chars at the end of the lineDaniel Eklöf2020-07-14-16/+1
| | | | | This is handled by the generic foreach() functions, which now simply skips spacer cells.
* term: print: write special value CELL_MULT_COL_SPACER to extra cellsDaniel Eklöf2020-07-14-4/+4
| | | | | | When printing a multi-column character, write CELL_MULT_COL_SPACER instead of '0' to both padding cells (when character doesn't fit at the end of the line), and to the cells following the actual character.
* term: rename COMB_CHARS_LO,HI -> CELL_COMB_CHARS_LO,HIDaniel Eklöf2020-07-14-2/+3
|
* selection: recognize empty padding cells in a forced linewrapDaniel Eklöf2020-07-14-9/+35
| | | | | | | | | | | | | | When printing a multi-column character at the end of the line, and it doesn't fit, we currently insert a forced line-wrap. This means the last character(s) on the previous line will be empty, followed by a multi-column character in the first cell on the next line. Without special code to handle this, the selection text extraction code will insert a hard newline, since this is normally the correct thing to do. Add a TODO, to consider writing a special place holder value to these padding cells.
* selection: foreach: don't call callback for trailing multi-character cellsDaniel Eklöf2020-07-14-1/+6
|
* seat: use separate 'enter' serials for keyboard and mouseDaniel Eklöf2020-07-09-2/+2
|
* multi-seat: improve handling of multiple (mouse) pointersDaniel Eklöf2020-07-09-2/+2
| | | | | | | | * xcursor always set for all pointers * xcursor sometimes not updated when it should be * mouse grabbed state wasn't per seat, but global (i.e. "does at least one seat enable mouse grabbing") * selection enabled state wasn't per seat
* multi-seat: re-enable selection support (excluding OSC 52)Daniel Eklöf2020-07-08-82/+57
|
* wip: multi-seat supportDaniel Eklöf2020-07-08-7/+36
| | | | | Compiles and runs, but mouse, clipboard and other things have been disabled.
* selection: fix typo when extending selection to cover double-width characterDaniel Eklöf2020-06-03-1/+1
|
* selection: don't allow only half of double-width characters to be selectedDaniel Eklöf2020-06-02-1/+28
|
* selection: performance: check for < 0 or >= 0 instead of == -1Daniel Eklöf2020-05-19-9/+9
|
* selection: handle viewport wrap around correctlyDaniel Eklöf2020-05-19-0/+28
| | | | | When the viewport wraps around, the selection points may be "incorrect".
* term: scrolling: hopefully fix all selection/scrolling related crashesDaniel Eklöf2020-05-17-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When scrolling, there are a couple of cases where an existing selection must be canceled because we cannot meaningfully represent it after scrolling. These are when the selection is (partly) inside: * The top scrolling region * The bottom scrolling region * The new lines scrolled in. I.e. re-used lines For the scrolling regions, the real problem is when the selection crosses the scrolling region boundary; a selection that is completely inside a scrolling regions _might_ be possible to keep, but we would need to translate the selection coordinates to the new scrolling region lines. For simplicity, we cancel the selection if it touches the scrolling region. Period. The last item, newly scrolled in lines is when the selection covers very old lines and we're now wrapping around the scrollback history. Then there's a fourth problem case: when the user has started a selection, but hasn't yet moved the cursor. In this case, we have no end point. What's more problematic is that when the user (after scrolling) moves the cursor, we try to create a huge selection that covers mostly empty (NULL) rows, causing us to crash. This can happen e.g. when reverse scrolling in such a way that we wrap around the scrollback history. The actual viewport in this case is something like `-n - m`. But the selection we'll end up trying to create will be `m - (rows - n)`. This range may very well contain NULL rows. To deal with this, we simply cancel the selection.
* selection: on_rows_in_view: fix range checkDaniel Eklöf2020-05-17-7/+5
|
* selection: copy: insert line break if either cell is emptyDaniel Eklöf2020-05-16-1/+2
|
* selection/render: sync cells' 'selected' bit before renderingDaniel Eklöf2020-05-16-0/+10
| | | | | | | | | | | | | | | | | | | | | | | For performance reasons, we track whether a cell is selected or not using a bit in a cell's attributes. This makes it easy for the renderer to determine if the cells should be rendered as selected or not - it just have to look at the 'selected' bit instead of doing a complex range check against the current selection. This works nicely in most cases. But, if the cell is updated, the 'selected' bit is cleared. This results in the renderer rendering the cell normally, i.e. _not_ selected. Checking for this, and re-setting the 'selected' bit when the cell is updated (printed to) is way too expensive as it is in the hot path. Instead, sync the 'selected' bits just before rendering. This isn't so bad as it may sound; if there is no selection this is a no-op. Even if there is a selection, only those cells whose 'selected' bit have been cleared are dirtied (and thus re-rendered) - these cells would have been re-rendered anyway.
* selection: update: don't assert on 'start' being setDaniel Eklöf2020-05-16-0/+1
|
* selection: don't automatically no-op operations if selection isn't enabledDaniel Eklöf2020-05-16-15/+0
| | | | | | | | | | | | | | | | | | When the client is capturing the mouse, selection can only be done by holding done shift. This is why a lot of selection functions are no-ops if selection isn't currently enabled. However, there are many cases where we actually need to modify the selection. In particular, selection_cancel(). Thus, only check for enabled selection when we're dealing with user input. Bonus: this also fixes a bug where an ongoing selection were finalized as soon as the user released shift, even if he was still holding down the mouse button.
* selection: on_row_in_view() -> on_rows_in_view(), and now takes a rangeDaniel Eklöf2020-05-16-4/+24
| | | | | This allows us to check the selection once when scrolling, instead of once for each scrolled in line.
* unicode-combining: store seen combining chains "globally" in the term structDaniel Eklöf2020-05-03-14/+10
| | | | | | | | | | | | | | | | | | | | 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.
* unicode-combine: remove utf8proc dependencyDaniel Eklöf2020-05-02-2/+2
| | | | | | | | | | | | 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.
* unicode-combining: completely remove unicode combining characters when feature is disabledDaniel Eklöf2020-05-01-2/+8
|
* selection: extract text: also copy combining charactersDaniel Eklöf2020-05-01-14/+23
|
* util.h: new header file defining commonly used macrosDaniel Eklöf2020-05-01-3/+1
|
* selection: extend: new row must be offsetted with the current view offsetDaniel Eklöf2020-04-04-0/+2
|
* selection: add selection_extend()Daniel Eklöf2020-04-04-14/+171
| | | | | | | | | | | | | | 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.
* term: convert cell 'linefeed' attribute to a row 'linebreak' propertyDaniel Eklöf2020-02-14-1/+1
| | | | | | | | | | | | | | | | 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.
* selection: handle line break at last column correctlyDaniel Eklöf2020-02-11-1/+2
| | | | | Insert a newline into the selection even if the last column contained a printable character, *if* that column also has linefeed=1.
* Revert "selection: use edge-triggered FDM handlers"Daniel Eklöf2020-01-10-3/+3
| | | | This reverts commit 5bac3cfa2cb6a1e7b6eb0012c134bd2e844fcf61.
* selection: use edge-triggered FDM handlersDaniel Eklöf2020-01-10-3/+3
|
* selection: finalize: ignore whether selections are 'enabled' or notDaniel Eklöf2020-01-06-3/+0
| | | | | | 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.
* selection: update: don't dirty cells that don't change stateDaniel Eklöf2020-01-06-18/+47
| | | | | | | | | | | | | | | | 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).
* selection: foreach_selection_*: must wrap row numberDaniel Eklöf2020-01-05-2/+6
| | | | | Fixes occasional crashes when we're at the end of the grid and selection wraps around.
* selection: min_bufsize_for_extraction: add one extra column for *all* rowsDaniel Eklöf2020-01-04-7/+4
|
* selection: rename selection_cell_count -> min_bufsize_for_extractionDaniel Eklöf2020-01-04-2/+2
|
* selection: cell count now adds one extra column per row, for \nDaniel Eklöf2020-01-04-3/+11
| | | | | | | | 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.
* selection: fix bug where first column on all rows but the first was lostDaniel Eklöf2020-01-04-10/+12
| | | | | | | | | | 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.
* selection: simplify extraction by converting to UTF-8 at the endDaniel Eklöf2020-01-04-21/+25
| | | | | 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.
* selection: extract_selection now uses foreach_selected()Daniel Eklöf2020-01-04-57/+105
| | | | | This "automagically" adds support for block selections, since foreach_selected already handles block selections.
* selection: selection_cancel() now sets 'kind' to SELECTION_NONEDaniel Eklöf2020-01-04-0/+5
|
* selection: store cell 'selected' state in the cells' attributesDaniel Eklöf2020-01-04-24/+119
| | | | | | | | | 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.