mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-15 08:21:03 -04:00
Add uppercase-regex-insert config option.
Fixes #2159. This makes the "uppercase hint character inserts selected text" behavior added in #1975 configurable, as it can have unexpected behavior for some users. It defaults to "off", preserving the original behavior of `foot` before #1975.
This commit is contained in:
parent
72d9a13c0c
commit
2a796d77e3
6 changed files with 21 additions and 1 deletions
|
|
@ -67,6 +67,13 @@
|
|||
|
||||
## Unreleased
|
||||
### Added
|
||||
|
||||
* The `uppercase-regex-insert` option controls whether an uppercase hint
|
||||
character will insert the selected text into the prompt in `regex-copy`
|
||||
or `show-urls-copy` mode. ([#2159]2159[]).
|
||||
|
||||
[2159]: https://codeberg.org/dnkl/foot/issues/2159
|
||||
|
||||
### Changed
|
||||
|
||||
* The label letters are no longer sorted before being assigned to URLs
|
||||
|
|
|
|||
4
config.c
4
config.c
|
|
@ -1111,6 +1111,9 @@ parse_section_main(struct context *ctx)
|
|||
(int *)&conf->initial_color_theme);
|
||||
}
|
||||
|
||||
else if (streq(key, "uppercase-regex-insert"))
|
||||
return value_to_bool(ctx, &conf->uppercase_regex_insert);
|
||||
|
||||
else {
|
||||
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
|
||||
return false;
|
||||
|
|
@ -3375,6 +3378,7 @@ config_load(struct config *conf, const char *conf_path,
|
|||
.strikeout_thickness = {.pt = 0., .px = -1},
|
||||
.dpi_aware = false,
|
||||
.gamma_correct = false,
|
||||
.uppercase_regex_insert = false,
|
||||
.security = {
|
||||
.osc52 = OSC52_ENABLED,
|
||||
},
|
||||
|
|
|
|||
1
config.h
1
config.h
|
|
@ -247,6 +247,7 @@ struct config {
|
|||
|
||||
bool dpi_aware;
|
||||
bool gamma_correct;
|
||||
bool uppercase_regex_insert;
|
||||
struct config_font_list fonts[4];
|
||||
struct font_size_adjustment font_size_adjustment;
|
||||
|
||||
|
|
|
|||
|
|
@ -231,6 +231,11 @@ empty string to be set, but it must be quoted: *KEY=""*)
|
|||
|
||||
Default: _no_.
|
||||
|
||||
*upppercase-regex-insert*
|
||||
Boolean. When enabled, inputting an uppercase hint character in
|
||||
*show-urls-copy* or *regex-copy* mode will insert the selected
|
||||
text into the prompt in addition to copying it to the clipboard.
|
||||
|
||||
*box-drawings-uses-font-glyphs*
|
||||
Boolean. When disabled, foot generates box/line drawing characters
|
||||
itself. The are several advantages to doing this instead of using
|
||||
|
|
|
|||
2
foot.ini
2
foot.ini
|
|
@ -40,6 +40,8 @@
|
|||
# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux)
|
||||
# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD)
|
||||
|
||||
# uppercase-regex-insert=no
|
||||
|
||||
[environment]
|
||||
# name=value
|
||||
|
||||
|
|
|
|||
|
|
@ -283,7 +283,8 @@ urls_input(struct seat *seat, struct terminal *term,
|
|||
|
||||
if (match) {
|
||||
// If the last hint character was uppercase, copy and paste
|
||||
activate_url(seat, term, match, serial, wc == toc32upper(wc));
|
||||
bool insert = term->conf->uppercase_regex_insert && wc == toc32upper(wc);
|
||||
activate_url(seat, term, match, serial, insert);
|
||||
|
||||
switch (match->action) {
|
||||
case URL_ACTION_COPY:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue