Commit Graph

353 Commits

Author SHA1 Message Date
nicm
1c1f4c1219 Use global cursor style and colour options for modes instead of default,
GitHub issue 4117.
2024-10-01 08:01:19 +00:00
nicm
141cd78407 Display hyperlinks in copy mode and add copy_cursor_hyperlink format to
get the hyperlink under the cursor.
2024-08-27 07:49:07 +00:00
nicm
d0c8124661 Add search_count and search_count_partial formats in copy mode, GitHub
issue 4091.
2024-08-27 07:31:26 +00:00
nicm
4823acca8f Add copy-mode -d flag to scroll a page down if in copy mode already,
from Michael Grant.
2024-08-26 07:09:34 +00:00
nicm
5b5004e5ac Revert part of the change for GitHub issue 3675 because it does not work
correctly, it was intended to skip lines that are already being searched
as part of a previous wrapped line but in fact is skipping all lines
except the last in wrapped lines.

Also revert the search-wrapped-lines option (I didn't realize it was
intended to work around this).
2024-05-14 09:32:37 +00:00
nicm
4c928dce74 Add an option to disable unwrapping lines for searching, from
meanderingprogrammer at gmail dot com, GitHub issue 3975.
2024-05-14 07:40:39 +00:00
jsg
ea9f416c99 correct indentation; no functional change
ok tb@
2024-04-23 13:34:51 +00:00
nicm
6207a45139 Fix selection present check, reported by M Kelly. 2024-03-26 10:20:20 +00:00
nicm
0c374868ca Do not consider a selection present if it is empty, from Michael Grant
(GitHub issue 3869). Also a typo fix from GitHub issue 3877.
2024-03-21 11:26:28 +00:00
nicm
5aadee6df4 next-prompt can have 1 argument. 2023-11-02 10:38:14 +00:00
nicm
43e5e80343 Skip wrapped lines in top level search loop because they will be
combined in the inner loop (in window_copy_search_rl_regex and the
others), avoids searching the same text multiple times. Also add a line
length limit for regex searches. GitHub issue 3675.
2023-09-04 08:01:43 +00:00
nicm
9456258ccc Rewrite combined character handling to be more consistent and to support
newer Unicode combined characters (which we have to "know" are combined
since they are not width zero). GitHub issue 3600.
2023-09-01 14:29:11 +00:00
nicm
7a44984069 Add flag to next-prompt/previous-prompt to go to command output instead,
from Magnus Gross.
2023-08-08 08:21:29 +00:00
nicm
43b841f188 Add support for marking lines with a shell prompt based on the OSC 133
extension, from Munif Tanjim in GitHub issue 3596.
2023-07-03 16:47:43 +00:00
nicm
a10452be2d Add scroll-top and scroll-bottom commands to scroll so cursor is at top
or bottom. From Anindya Mukherjee, GitHub issue 3334.
2022-09-28 07:59:50 +00:00
nicm
416c27c995 Add scroll-middle copy mode command to make cursor line in the middle,
from Varun Kumar E in GitHub issue 3307.
2022-08-23 08:14:19 +00:00
nicm
c6e7568471 Do not crash when searching for .* with extremely long lines. Reported
by Torbjorn Lonnemark, GitHub issue 3272.
2022-08-03 13:27:48 +00:00
nicm
a8da24771c Clear marks when the search string changes. From Anindya Mukherjee,
GitHub issue 3255.
2022-07-22 07:14:07 +00:00
nicm
9c89f7c2af Store time lines are scrolled into history and display in copy mode. 2022-06-21 09:30:01 +00:00
nicm
ccc9dc3bb4 If an application gives the first parameter to OSC 52, validate and pass
on to outside terminal. GitHub issue 3192.
2022-06-09 09:12:55 +00:00
nicm
cd89000c1d Add a way for lines added to copy mode to be passed through the parser
to handle escape sequences and use it for run-shell, GitHub issue 3156.
2022-05-30 13:00:18 +00:00
nicm
5080acc127 Add a key in copy mode to toggle position indicator. 2022-02-03 07:26:43 +00:00
nicm
e4856de8bf Do not crash on a zero size character. 2021-12-20 09:02:12 +00:00
nicm
759efe1b33 Add -e flag to set environment for popup, from Alexis Hildebrandt in
GitHub issue 2924.
2021-10-11 10:55:30 +00:00
nicm
caa8703a23 Spacing tweaks. 2021-08-20 20:04:22 +00:00
nicm
5f32b7d961 Hide struct args behind a couple of accessor functions. 2021-08-20 19:50:16 +00:00
nicm
c76b28de24 Remove some unnecessary blank lines. 2021-08-20 19:08:36 +00:00
nicm
e463e8622d Remove stray spaces after function names. 2021-08-20 17:50:42 +00:00
nicm
01fd4b997e Add pipe variants of the line copy commands. While here make the command
list less unreadable. GitHub issue 2813.
2021-08-11 20:35:46 +00:00
nicm
be5988457f Change copy-line and copy-end-of-line not to cancel and add -and-cancel
variants, like the other copy commands. GitHub issue 2799.
2021-08-09 13:08:08 +00:00
nicm
43514f4af6 Fix rectangle selection, from Anindya Mukherjee, GitHub issue 2709. 2021-06-10 07:58:42 +00:00
nicm
77b1290698 More accurate vi(1) word navigation in copy mode and on the status line.
This changes the meaning of the word-separators option - setting it to
the empty string is equivalent to the previous behavior. From Will Noble
in GitHub issue 2693.
2021-06-10 07:56:47 +00:00
nicm
5900b164a4 Fix a couple of edge cases with the jump-back-xxx commands, and also
update back-to-indentation to use grid_reader, thereby fixing line
wrapping issues. From Anindya Mukherjee, GitHub issue 2633.
2021-04-05 08:43:48 +00:00
nicm
28cd956729 Change search-again with vi keys to work like actual vi(1), also some
other fixes. From Aaron Jensen with help from Anindya Mukherjee.
2021-04-01 06:46:12 +00:00
nicm
7f87280cd5 Allow cursor to be just after match if copying, GitHub issue 2602. 2021-03-09 13:07:50 +00:00
nicm
81e5736510 Copy mode improvements from Anindya Mukherjee:
- Fix word and word-end for wrapped lines.
- Fix copying of selection end on wrapped lines.
- Fix wrapped word selection edge case.
- Update select-line to respect wrapped lines.
- Update window_copy_..._pos() functions to use grid_reader.

GitHub issue 2605.
2021-03-09 08:24:09 +00:00
nicm
c44750792a Drop support for popups where the content is provided directly to tmux
(which does not have many practical uses) and only support running a
program in the popup. display-popup is now simpler and can accept
multiple arguments to avoid escaping problems (like the other commands).
2021-03-02 10:56:45 +00:00
nicm
5f425ee318 Fix regex searching with wrapped lines, from Anindya Mukherjee; GitHub
issue 2570.
2021-02-22 08:31:19 +00:00
nicm
e858270006 There are many format variables now so allocating all the default ones
each time a tree is created is too expensive. Instead, convert them all
into callbacks and put them in a static table so they only allocate on
demand. The tree remains for the moment for extra (non-default)
variables added by for example copy mode or popups. Also reduce
expensive calls to localtime_r/strftime. GitHub issue 2253.
2021-02-22 07:09:06 +00:00
nicm
8986c8dfcd Move jump commands to grid reader, make them UTF-8 aware, and tidy up,
from Anindya Mukherjee.
2021-02-22 06:53:04 +00:00
nicm
e3005e5ec4 Add "pipe" variants of the "copy-pipe" commands which do not copy, from
Christian Zangl.
2021-02-08 14:46:53 +00:00
nicm
bba71f696f Add rectangle-on and rectangle-off copy mode commands, GitHub isse 2546
from author at will dot party.
2021-01-22 10:24:52 +00:00
nicm
8d185395e4 Fix some cursor movement commands, from Anindya Mukherjee. 2021-01-22 10:21:24 +00:00
nicm
0730dce5ab Hide some warnings on newer GCC versions, GitHUb issue 2525. 2021-01-18 11:14:23 +00:00
nicm
b96c5e3687 With incremental search, start empty and only repeat the previous search
if the user tries to search again with an empty prompt. This matches
emacs behaviour more closely.
2021-01-08 08:22:10 +00:00
nicm
ccb8b9eb2a Remove unused variable, from Ben Boeckel. 2021-01-06 07:29:49 +00:00
nicm
c68baaad98 Remove current match indicator which can't work anymore since we only
search the visible region. From Anindya Mukherjee, GitHub issue 2508.
2020-12-28 09:36:26 +00:00
nicm
c43f2dce1b Break cursor movement in grid into a common set of functions that can
handle line wrapping and so on in one place and use them for the obvious
copy mode commands. From Anindya Mukherjee.
2020-12-22 09:22:14 +00:00
nicm
bbab5b7a30 Allow previous-word to scroll onto the first line, noticed by Anindya
Mukherjee.
2020-11-10 08:16:52 +00:00
nicm
b9392d5cb1 Do not wrap at end of text when positioning at end of match because the
length may include trailing spaces.
2020-09-22 08:41:27 +00:00