From a5c43df2d5ab0e961ab18a0b4e458a978850ecc7 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Wed, 30 Apr 2025 06:44:52 -0400 Subject: [PATCH] Use 32-bit char comparison, update docs. --- CHANGELOG.md | 2 ++ doc/foot.ini.5.scd | 9 ++++++--- url-mode.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f231a1be..1cd4a325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,8 @@ - paper-color - selenized - solarized +* `regex-copy`/`show-urls-copy` will copy and paste the selected text if the hint + is completed with an uppercase character. [2025]: https://codeberg.org/dnkl/foot/issues/2025 diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 215809f8..4a14884c 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -1348,7 +1348,8 @@ e.g. *search-start=none*. *show-urls-launch* Enter URL mode, where all currently visible URLs are tagged with a jump label with a key sequence that will open the URL (and exit - URL mode). Default: _Control+Shift+o_. + URL mode). If the hint is completed with an uppercase character, + the match will also be pasted. Default: _Control+Shift+o_. *show-urls-persistent* Similar to *show-urls-launch*, but does not automatically exit URL @@ -1380,8 +1381,10 @@ e.g. *search-start=none*. Default: _none_. *regex-copy* - Same as *regex-copy*, but the match is placed in the clipboard, - instead of "launched", upon activation. Default: _none_. + Same as *regex-launch*, but the match is placed in the clipboard, + instead of "launched", upon activation. If the hint is completed + with an uppercase character, the match will also be pasted. + Default: _none_. *prompt-prev* Jump to the previous, currently not visible, prompt (requires diff --git a/url-mode.c b/url-mode.c index 828adf22..19193b64 100644 --- a/url-mode.c +++ b/url-mode.c @@ -278,7 +278,7 @@ urls_input(struct seat *seat, struct terminal *term, switch (match->action) { case URL_ACTION_COPY: // If the last hint character was uppercase, copy and paste - if (wc >= 'A' && wc <= 'Z') { + if (wc == toc32upper(wc)) { if (term->bracketed_paste) term_to_slave(term, "\033[200~", 6);