Daniel Eklöf
a17ce10c03
search: match_to_end_of_word: reset end_col when done with a row
2019-12-03 20:26:32 +01:00
Daniel Eklöf
0f98101bbc
search: match_to_end_of_word: bug: reset end-col when bumping end-row
...
When we calculate the end coords, we must reset end-col when we reach
the end of the line and bump the end-row.
This fixes an issue where bumping the row once lead to the end row
being bumped for *each* remaining match character.
2019-12-03 20:25:22 +01:00
Daniel Eklöf
6cfb3216c3
search: bug: restore end-col/end-row adjustment
...
Turns out end_col *can* be exactly 0. In this case, we need to adjust
the end-row too.
2019-12-03 20:24:41 +01:00
Daniel Eklöf
008281757b
search: bug: re-initialize start-row when attempting a new match
...
When we've already found a partial match (but *not* a complete match),
and that match spanned multiple lines, then when we continued with the
next start-column we re-used a know-wrong row pointer.
2019-12-03 20:00:38 +01:00
Daniel Eklöf
0982210af2
search: map ctrl+shift+w to match to end of word, spaces only
...
This works just like ctrl+w, except that the only space separating
characters are whitespaces.
2019-12-03 19:43:45 +01:00
Daniel Eklöf
867cac4207
search: search_match_to_end_of_word: rename start_{row,col} -> end_{row,col}
2019-12-03 19:43:11 +01:00
Daniel Eklöf
2a5da66e4e
search: split up search_update() into two
...
* search_find_next() searches the scrollback, continuing from the last
match. The assumption is that the search buffer has changed.
* search_update_selection() updates the selection and moves the view
to ensure the selection is visible. Note that it doesn't verify the
selection actually matches the search buffer.
2019-12-03 19:40:22 +01:00
Daniel Eklöf
e003736e11
search: rename search_update() -> search_find_next()
2019-12-03 19:24:33 +01:00
Daniel Eklöf
b5a04dcaae
search: map ctrl+w to 'extend current selection to end of word'
...
If the user has started a scrollback search and have some matching
text, he can now press ctrl+w to extend that selection (and thus the
search criteria too) to the end of the current word, or to the end of
the next word if currently at a word separating character.
2019-12-03 19:22:47 +01:00
Daniel Eklöf
694d84a9e9
search: discard canceled compose sequences
2019-12-03 19:21:16 +01:00
Daniel Eklöf
a34deabcc9
Revert "search: discard canceled compose sequences"
...
This reverts commit f67733c0e3 .
2019-12-03 19:21:03 +01:00
Daniel Eklöf
f67733c0e3
search: discard canceled compose sequences
2019-12-03 19:19:55 +01:00
Daniel Eklöf
ac2eda885a
search: remove debug log
2019-12-03 19:19:26 +01:00
Daniel Eklöf
10cf722617
search: don't line-wrap unless we actually have a match on the next row
...
When matching characters, we moved on to next row directly after
matching the last character in a row.
This was wrong since if that last character was the last matching
character, we tried to create a selection that was on the wrong row.
2019-12-03 19:17:51 +01:00
Daniel Eklöf
d94fc80966
search: break out search buffer resize code to a new function
2019-12-03 19:17:34 +01:00
Daniel Eklöf
b5780e735e
Add missing includes
2019-12-01 19:22:45 +01:00
Daniel Eklöf
876cd6895f
search: update xcursor when starting and ending a search
2019-11-29 22:11:15 +01:00
Daniel Eklöf
61cc8c3c55
wayland: implement wayl_init()
...
Wayland instantiation is now done by the wayland backend, not in main.
2019-10-27 19:08:48 +01:00
Daniel Eklöf
1adab32906
term: wayland struct is now not a part of the terminal struct
...
We do however need access to it, so provide a pointer. The difference
is that now we can have a *single* wayland instance, but multiple
terminal instances.
2019-10-27 18:51:14 +01:00
Daniel Eklöf
9f0b1f94c2
wayland: change all wayland callbacks to take a wayland pointer
...
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
2019-10-27 18:43:07 +01:00
Daniel Eklöf
c9455d5f21
kbd: move into wayland
2019-10-27 17:10:32 +01:00
Daniel Eklöf
f63458ef33
term: move per-window wayland objects from wayland struct to terminal struct
...
Short term, we want to break out the wayland backend from the terminal
struct. Long term, we might want to support multiple windows.
One step towards both the above is separating global wayland objects
from per-window objects.
2019-10-27 12:57:37 +01:00
Daniel Eklöf
e2aeb7e515
search: map ctrl+b/f to move cursor single character backward/forward
2019-08-30 20:55:45 +02:00
Daniel Eklöf
f24a40a391
search: ctrl+s searches forward
2019-08-30 20:15:36 +02:00
Daniel Eklöf
556bf95b28
search: make search-direction configurable
2019-08-30 20:15:12 +02:00
Daniel Eklöf
42714c51a9
search: fix distance to prev word calculation when final cursor was 0
2019-08-30 19:42:48 +02:00
Daniel Eklöf
0fceed6f00
search: implement move cursor word backward/forward
2019-08-30 19:37:18 +02:00
Daniel Eklöf
64460c5abe
search: implement delete word backward/forward
2019-08-30 19:37:06 +02:00
Daniel Eklöf
61318d068e
search: utility functions distance_{next,prev}_word()
...
These functions calculate the distance from the current cursor to the
next/previous word.
2019-08-30 19:36:37 +02:00
Daniel Eklöf
db291573b7
Revert "search: for now, reset search match state whenever the buffer changes"
...
This reverts commit 9c6ece747e .
2019-08-29 21:16:25 +02:00
Daniel Eklöf
9c6ece747e
search: for now, reset search match state whenever the buffer changes
2019-08-29 21:10:13 +02:00
Daniel Eklöf
4c9e7d0c19
search: call render_search_box() from search_inptu()
2019-08-29 21:09:49 +02:00
Daniel Eklöf
4d0ea11454
search: add basic cursor navigation support
2019-08-29 21:05:18 +02:00
Daniel Eklöf
10649178f8
search: insert new characters at cursor, not at the end of the buffer
2019-08-29 21:03:46 +02:00
Daniel Eklöf
6003b87813
search: search_cancel: reset cursor position
2019-08-29 21:03:16 +02:00
Daniel Eklöf
6d5f200429
search: turn info log to a debug log
2019-08-29 20:23:59 +02:00
Daniel Eklöf
7d920a6d1b
search: remove INFO log (that really was a debug log)
2019-08-29 20:23:55 +02:00
Daniel Eklöf
1e4b11b0fa
search: don't destroy/recreate search (sub)surface
...
Create the sub-surface once, at startup. Then, instead of destroying
it when committing/cancelling a search, unmap it (by attaching a NULL
buffer to it).
2019-08-29 20:22:07 +02:00
Daniel Eklöf
2c3ab701e7
search: move render() function to the 'render' module
2019-08-29 20:18:06 +02:00
Daniel Eklöf
44a353a7f7
search: move wayland surface variables into the term struct
2019-08-29 20:15:33 +02:00
Daniel Eklöf
66912cbfb5
search: use a sub-surface to render the search buffer
2019-08-29 19:34:41 +02:00
Daniel Eklöf
94b4c916ee
search: cancel existing selection when starting a new search
2019-08-28 21:54:02 +02:00
Daniel Eklöf
0d0ee8f378
search: log search buffer at INFO level
...
... until we actually render the search buffer somehow
2019-08-28 21:03:30 +02:00
Daniel Eklöf
b8b43e2eab
search: fix start/end row in selection
2019-08-28 17:28:26 +02:00
Daniel Eklöf
64179bce46
search: start search in current view, rather than from end-of-output
2019-08-28 17:28:26 +02:00
Daniel Eklöf
064063fa49
search: match case insensitive
2019-08-27 21:16:57 +02:00
Daniel Eklöf
bd5e579867
search: sort includes
2019-08-27 21:11:40 +02:00
Daniel Eklöf
36350b01a5
search: disable log output
2019-08-27 21:11:29 +02:00
Daniel Eklöf
2759152285
search: loop through the *entire* scrollback buffer
2019-08-27 21:09:37 +02:00
Daniel Eklöf
2895f8fa10
search: cancel selection and clear match stats when we don't match
2019-08-27 19:58:44 +02:00