mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-08 08:20:59 -04:00
Merge branch 'master' into scrollback-position-indicator
This commit is contained in:
commit
5c20069588
5 changed files with 32 additions and 13 deletions
|
|
@ -18,6 +18,8 @@
|
||||||
* [LICENSE](LICENSE), [README.md](README.md) and
|
* [LICENSE](LICENSE), [README.md](README.md) and
|
||||||
[CHANGELOG.md](CHANGELOG.md) are now installed to
|
[CHANGELOG.md](CHANGELOG.md) are now installed to
|
||||||
`${datadir}/doc/foot`.
|
`${datadir}/doc/foot`.
|
||||||
|
* Support for escaping quotes in **pipe-visible** and
|
||||||
|
**pipe-scrollback** commands.
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
@ -35,6 +37,8 @@
|
||||||
outside it.
|
outside it.
|
||||||
* Scrollback search to focus match, that requires a viewport change,
|
* Scrollback search to focus match, that requires a viewport change,
|
||||||
roughly in the center of the screen.
|
roughly in the center of the screen.
|
||||||
|
* Extending a selection with the right mouse button now works while
|
||||||
|
dragging the mouse.
|
||||||
* Mouse cursor is now always a `left_ptr` when inside the margins, to
|
* Mouse cursor is now always a `left_ptr` when inside the margins, to
|
||||||
indicate it is not possible to start a selection.
|
indicate it is not possible to start a selection.
|
||||||
* Scrollback position indicator. This feature is optional and
|
* Scrollback position indicator. This feature is optional and
|
||||||
|
|
@ -46,7 +50,10 @@
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* Crash in scrollback search
|
* Crash in scrollback search.
|
||||||
|
* Crash when a **pipe-visible** or **pipe-scrollback** command
|
||||||
|
contained an unclosed quote
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/49).
|
||||||
* Crash when starting a selection inside the margins.
|
* Crash when starting a selection inside the margins.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ This section lets you override the default key bindings.
|
||||||
The general format is _action=combo1...comboN_. That is, each action
|
The general format is _action=combo1...comboN_. That is, each action
|
||||||
may have one or more key combinations, space separated. Each
|
may have one or more key combinations, space separated. Each
|
||||||
combination is on the form _mod1+mod2+key_. The names of the modifiers
|
combination is on the form _mod1+mod2+key_. The names of the modifiers
|
||||||
and the key *must* be a valid XKB key name.
|
and the key *must* be valid XKB key names.
|
||||||
|
|
||||||
Note that if *Shift* is one of the modifiers, the _key_ *must* be in
|
Note that if *Shift* is one of the modifiers, the _key_ *must* be in
|
||||||
upper case. For example, *Control+Shift+v* will never trigger -
|
upper case. For example, *Control+Shift+v* will never trigger -
|
||||||
|
|
|
||||||
2
input.c
2
input.c
|
|
@ -1187,7 +1187,7 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
|
||||||
if (seat->mouse.col < 0 || seat->mouse.row < 0)
|
if (seat->mouse.col < 0 || seat->mouse.row < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
bool update_selection = seat->mouse.button == BTN_LEFT;
|
bool update_selection = seat->mouse.button == BTN_LEFT || seat->mouse.button == BTN_RIGHT;
|
||||||
bool update_selection_early = term->selection.end.row == -1;
|
bool update_selection_early = term->selection.end.row == -1;
|
||||||
|
|
||||||
if (update_selection && update_selection_early)
|
if (update_selection && update_selection_early)
|
||||||
|
|
|
||||||
16
selection.c
16
selection.c
|
|
@ -373,8 +373,8 @@ selection_extend_normal(struct terminal *term, int col, int row, uint32_t serial
|
||||||
|
|
||||||
if (row < start->row || (row == start->row && col < start->col)) {
|
if (row < start->row || (row == start->row && col < start->col)) {
|
||||||
/* Extend selection to start *before* current start */
|
/* Extend selection to start *before* current start */
|
||||||
new_start = (struct coord){col, row};
|
new_start = *end;
|
||||||
new_end = *end;
|
new_end = (struct coord){col, row};
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (row > end->row || (row == end->row && col > end->col)) {
|
else if (row > end->row || (row == end->row && col > end->col)) {
|
||||||
|
|
@ -392,8 +392,8 @@ selection_extend_normal(struct terminal *term, int col, int row, uint32_t serial
|
||||||
abs(linear - (end->row * term->cols + end->col)))
|
abs(linear - (end->row * term->cols + end->col)))
|
||||||
{
|
{
|
||||||
/* Move start point */
|
/* Move start point */
|
||||||
new_start = (struct coord){col, row};
|
new_start = *end;
|
||||||
new_end = *end;
|
new_end = (struct coord){col, row};
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
@ -441,13 +441,13 @@ selection_extend_block(struct terminal *term, int col, int row, uint32_t serial)
|
||||||
/* Move one of the top corners */
|
/* Move one of the top corners */
|
||||||
|
|
||||||
if (abs(col - top_left.col) < abs(col - top_right.col)) {
|
if (abs(col - top_left.col) < abs(col - top_right.col)) {
|
||||||
new_start = (struct coord){col, row};
|
new_start = bottom_right;
|
||||||
new_end = bottom_right;
|
new_end = (struct coord){col, row};
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
new_start = (struct coord){col, row};
|
new_start = bottom_left;
|
||||||
new_end = bottom_left;
|
new_end = (struct coord){col, row};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
16
tokenize.c
16
tokenize.c
|
|
@ -38,14 +38,16 @@ tokenize_cmdline(char *cmdline, char ***argv)
|
||||||
char delim = first_token_is_quoted ? cmdline[0] : ' ';
|
char delim = first_token_is_quoted ? cmdline[0] : ' ';
|
||||||
|
|
||||||
char *p = first_token_is_quoted ? &cmdline[1] : &cmdline[0];
|
char *p = first_token_is_quoted ? &cmdline[1] : &cmdline[0];
|
||||||
|
char *search_start = p;
|
||||||
|
|
||||||
size_t idx = 0;
|
size_t idx = 0;
|
||||||
while (*p != '\0') {
|
while (*p != '\0') {
|
||||||
char *end = strchr(p, delim);
|
char *end = strchr(search_start, delim);
|
||||||
if (end == NULL) {
|
if (end == NULL) {
|
||||||
if (delim != ' ') {
|
if (delim != ' ') {
|
||||||
LOG_ERR("unterminated %s quote\n", delim == '"' ? "double" : "single");
|
LOG_ERR("unterminated %s quote", delim == '"' ? "double" : "single");
|
||||||
free(*argv);
|
free(*argv);
|
||||||
|
*argv = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,6 +59,15 @@ tokenize_cmdline(char *cmdline, char ***argv)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (end > p && *(end - 1) == '\\') {
|
||||||
|
/* Escaped quote, remove one level of escaping and
|
||||||
|
* continue searching for "our" closing quote */
|
||||||
|
memmove(end - 1, end, strlen(end));
|
||||||
|
end[strlen(end) - 1] = '\0';
|
||||||
|
search_start = end;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
|
||||||
if (!push_argv(argv, &argv_size, p, &idx))
|
if (!push_argv(argv, &argv_size, p, &idx))
|
||||||
|
|
@ -74,6 +85,7 @@ tokenize_cmdline(char *cmdline, char ***argv)
|
||||||
p++;
|
p++;
|
||||||
} else
|
} else
|
||||||
delim = ' ';
|
delim = ' ';
|
||||||
|
search_start = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!push_argv(argv, &argv_size, NULL, &idx))
|
if (!push_argv(argv, &argv_size, NULL, &idx))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue