Commit Graph

267 Commits

Author SHA1 Message Date
nicm
e9e5facb0e Some minor style nits. 2020-04-09 14:23:34 +00:00
nicm
b96ac80901 Some unnecessary assignments and unused variables. 2020-04-09 13:52:31 +00:00
nicm
77b827f879 Change copy mode to make copy of the pane history so it does not need to
freeze updates (which does not play nicely with some applications, a
longstanding problem) and will allow some other changes later. From
Anindya Mukherjee.
2020-04-06 17:51:34 +00:00
nicm
b65eab5505 Check previous line rather than an extra line, from Anindya Mukherjee. 2020-04-03 05:18:02 +00:00
nicm
a20d96000e Only search the visible part of the history when marking (highlighting)
search terms, much faster than searching the whole history.
2020-04-02 17:03:10 +00:00
nicm
567b27e10a Add a 10 second timeout to prevent searches taking too much time, from
Anindya Mukherjee.
2020-04-01 09:36:37 +00:00
nicm
cd30633d10 Do not go down the regex search path (which is expensive because we need
to convert the grid data into a string for regexec and reverse it to
find the grid position) if the search string does not contain any regex
special characters.
2020-04-01 08:07:05 +00:00
nicm
c129ed3233 Use a comparison to check for wrap and avoid an expensive modulus. 2020-04-01 07:52:07 +00:00
nicm
89d2a20e56 Performance improvements for regex searching, most notably:
- Use the grid data directly instead of copying it.

- Special case the most typical one byte character cells and use memcmp
  for multiple bytes instead of a handrolled loop.

- Hoist regcomp out of the loop into the calling functions.

GitHub issue 2143.

Also a man page from from jmc@.
2020-04-01 07:35:10 +00:00
nicm
b66d62d2d0 Do not go down the regex search path (which is expensive because we need
to convert the grid data into a string for regexec and reverse it to
find the grid position) if the search string does not contain any regex
special characters.
2020-04-01 08:07:05 +00:00
nicm
46092f2760 Use a comparison to check for wrap and avoid an expensive modulus. 2020-04-01 07:52:07 +00:00
nicm
46ed81fc45 Performance improvements for regex searching, most notably:
- Use the grid data directly instead of copying it.

- Special case the most typical one byte character cells and use memcmp
  for multiple bytes instead of a handrolled loop.

- Hoist regcomp out of the loop into the calling functions.

GitHub issue 2143.

Also a man page from from jmc@.
2020-04-01 07:35:10 +00:00
nicm
2624edde46 Add non-regex search variants to avoid the performance cost for people
with large histories or long lines.
2020-03-31 16:53:23 +00:00
nicm
af6ae35900 Set end position correctly, GitHub issue 2129 from Anindya Mukherjee. 2020-03-21 13:19:56 +00:00
nicm
9a55f65702 Fix select-word when not on a word, from Anindya Mukherjee. 2020-03-20 20:12:39 +00:00
nicm
06c3079d66 Make the mouse_word and mouse_line formats work in copy mode and enable
the default pane menu in copy mode.
2020-03-20 17:59:39 +00:00
nicm
a3ff5a9e25 select_word_end needs to forward no_reset flag or select-word selects
too much.
2020-03-20 13:12:04 +00:00
nicm
c3e96cce4e Another fix to make other-end forget the selection mode, from Anindya Mukherjee. 2020-03-20 06:09:19 +00:00
nicm
e8273a993e Add a flag to run a background process in a pty as well, not used for
anything yet.
2020-03-19 13:43:18 +00:00
nicm
2cd8ea7680 Various fixes to copying with select-word and select-line, including
making it consistent with keys and with the mouse, and using other-end.
From Anindya Mukherjee.
2020-03-19 13:28:52 +00:00
nicm
7021757c9d Adjust selection correctly when scrolling, from Anindya Mukherjee. 2020-03-16 14:17:56 +00:00
nicm
882d0b785d Reset selection flag when clearing or stopping selection, from Mark
Kelly.
2020-03-15 20:44:19 +00:00
nicm
7863445e5d Add a copy-mode -H flag to hide the position marker in the top right. 2020-03-12 13:19:20 +00:00
nicm
4eba98313c Start a new selection if outside the existing selection after a word has
been selected. From Anindya Mukherjee.
2020-03-11 18:46:42 +00:00
nicm
f65b9c0d36 Change mouse selection so that after selecting a word, dragging selects
only words and similar for lines. From Anindya Mukherjee.
2020-02-24 09:53:59 +00:00
nicm
229be034fb Add selection_active format for when the selection is present but not
moving with the cursor, from Mark Kelly.
2020-02-20 07:34:57 +00:00
nicm
f48b041cf2 Do not jump to next word end if already on a word end when selecting a
word. Fixes select-word with single character words and vi(1) keys. From
Mark Kelly.
2020-02-13 09:02:07 +00:00
nicm
4ea07716de Support regex search in copy mode, from Anindya Mukherjee in GitHub
issue 2038.
2019-12-27 18:42:49 +00:00
nicm
64fb7e472a Tweak previous to check the wrapped flag and stop if not set. 2019-12-11 18:30:29 +00:00
nicm
ab630f72ed Allow search across wrapped lines and fix some inconsistencies in how th
position is represented, GitHub issue 2014 from Anindya Mukherjee.
2019-12-11 18:23:34 +00:00
nicm
58f870ef6e Don't use motion flag uninitialized. 2019-11-25 22:38:36 +00:00
nicm
87a11a9214 Fix a warning in previous. 2019-11-25 20:43:32 +00:00
nicm
c2fde58701 Do not clear search marks on cursor movement with vi(1) keys, from Eric
Pruitt in GitHub issue 1985.
2019-11-25 20:42:18 +00:00
nicm
c225262e13 Add -F flag to send-keys to expand formats in search-backward and
forward copy mode commands, this makes it easier to use the cursor_word
and cursor_line formats. From Anindya Mukherjee in GitHub issue 1964.
2019-11-07 07:11:25 +00:00
nicm
f7fb5df543 Use the existing code in format.c to add foramts for word and line at
cursor position in copy mode, from Anindya Mukherjee.
2019-10-23 07:42:05 +00:00
nicm
56e5067c46 Add formats for cursor and selection position in copy mode, from Jason Felice. 2019-10-19 19:20:14 +00:00
nicm
4b7e97ba53 Set up format tree for %if, GitHub issue 1896. 2019-09-10 07:50:33 +00:00
nicm
b31515fec3 Add cursor-down-and-cancel, from Mark Kelly. 2019-09-09 08:01:21 +00:00
nicm
21fae50089 Default to previous search string for search-forward and
search-backward, from Leah Neukirchen.
2019-08-14 10:02:24 +00:00
nicm
c4744620af Correctly wrap search in copy mode even if at the very top left, GitHub
issue 1845.
2019-08-01 14:31:39 +00:00
nicm
3d660b0023 Select the correct word for select-word when already at the start of a
word, GitHub issue 1820.
2019-08-01 14:30:31 +00:00
nicm
a4be028b76 Clear search marks before resize, GitHub issue 1823. 2019-07-08 20:29:11 +00:00
nicm
55c694a467 Do not use uninitialized buffer name. 2019-07-05 07:52:27 +00:00
nicm
26b9a8e49b Set the cursor x at the same time as changing the y or the end of line
marker may not be redrawn.
2019-06-13 20:38:05 +00:00
nicm
09e90c1645 Need to increment the argument to skip the prefix earlier, fixes
repeated incremental search in copy mode, reported by Kaushal Modi in
GitHub issue 1780.
2019-06-05 19:00:36 +00:00
nicm
e90d4a6021 Add formats for word and line under the mouse and use them to add some
items to the pane menu.
2019-05-26 17:34:45 +00:00
nicm
cf4566b47b Fix dragging when in view mode rather than copy mode, GitHub issue 1740
from Brad Town.
2019-05-15 19:25:53 +00:00
nicm
00f19b7f91 Fix some indentation and dead assignments. 2019-05-12 18:16:33 +00:00
nicm
d53d3bce59 Adjust the same bit to adjust the selection for history-top and
history-bottom as for cursor-up and cursor-down. GitHub issue 1723.
2019-05-07 19:46:17 +00:00
nicm
4097257bef Do not store the mouse position we calculate as the start of a drag back
into the mouse event that later code uses, it has been adjusted and they
should use the original position. GitHub issue 1710.
2019-05-03 18:42:40 +00:00