selection: selections can be made, and are rendered

* Start selection on mouse button down
* Update selection on motion
* Button release cancels selection if there were no motion after start
* Renderer detects cells inside the selection and inverts their colors
This commit is contained in:
Daniel Eklöf 2019-07-10 20:57:09 +02:00
parent decb4503bf
commit 632790d5d8
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 57 additions and 1 deletions

4
main.c
View file

@ -313,6 +313,10 @@ main(int argc, char *const *argv)
},
.foreground = default_foreground,
.background = default_background,
.selection = {
.start = {-1, -1},
.end = {-1, -1},
},
.normal = {.damage = tll_init(), .scroll_damage = tll_init()},
.alt = {.damage = tll_init(), .scroll_damage = tll_init()},
.grid = &term.normal,