mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
selection: combine enum selection_kind with selection_semantic
This commit is contained in:
parent
fcca3d3e55
commit
3a9172342f
6 changed files with 47 additions and 38 deletions
16
input.c
16
input.c
|
|
@ -275,8 +275,7 @@ execute_binding(struct seat *seat, struct terminal *term,
|
|||
case BIND_ACTION_SELECT_BEGIN:
|
||||
if (selection_enabled(term, seat) && cursor_is_on_grid) {
|
||||
selection_start(
|
||||
term, seat->mouse.col, seat->mouse.row,
|
||||
SELECTION_NORMAL, SELECTION_SEMANTIC_NONE, false);
|
||||
term, seat->mouse.col, seat->mouse.row, SELECTION_CHAR_WISE, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -284,8 +283,7 @@ execute_binding(struct seat *seat, struct terminal *term,
|
|||
case BIND_ACTION_SELECT_BEGIN_BLOCK:
|
||||
if (selection_enabled(term, seat) && cursor_is_on_grid) {
|
||||
selection_start(
|
||||
term, seat->mouse.col, seat->mouse.row,
|
||||
SELECTION_BLOCK, SELECTION_SEMANTIC_NONE, false);
|
||||
term, seat->mouse.col, seat->mouse.row, SELECTION_BLOCK, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -301,8 +299,7 @@ execute_binding(struct seat *seat, struct terminal *term,
|
|||
case BIND_ACTION_SELECT_WORD:
|
||||
if (selection_enabled(term, seat) && cursor_is_on_grid) {
|
||||
selection_start(
|
||||
term, seat->mouse.col, seat->mouse.row,
|
||||
SELECTION_NORMAL, SELECTION_SEMANTIC_WORD, false);
|
||||
term, seat->mouse.col, seat->mouse.row, SELECTION_WORD_WISE, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -310,16 +307,15 @@ execute_binding(struct seat *seat, struct terminal *term,
|
|||
case BIND_ACTION_SELECT_WORD_WS:
|
||||
if (selection_enabled(term, seat) && cursor_is_on_grid) {
|
||||
selection_start(
|
||||
term, seat->mouse.col, seat->mouse.row,
|
||||
SELECTION_NORMAL, SELECTION_SEMANTIC_WORD, true);
|
||||
term, seat->mouse.col, seat->mouse.row, SELECTION_WORD_WISE, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case BIND_ACTION_SELECT_ROW:
|
||||
if (selection_enabled(term, seat) && cursor_is_on_grid) {
|
||||
selection_start(term, seat->mouse.col, seat->mouse.row,
|
||||
SELECTION_NORMAL, SELECTION_SEMANTIC_ROW, false);
|
||||
selection_start(
|
||||
term, seat->mouse.col, seat->mouse.row, SELECTION_LINE_WISE, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue