Commit graph

608 commits

Author SHA1 Message Date
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
2ca7400cc6
render: render_search_box: draw cursor as a bar 2019-08-29 21:03:00 +02:00
Daniel Eklöf
27da0d7f28
term: add a 'cursor' (position) to the search state 2019-08-29 21:02:35 +02:00
Daniel Eklöf
bffa1f05ac
render: draw_strikeout: use font_baseline() for baseline calculation 2019-08-29 20:42:57 +02:00
Daniel Eklöf
1f98c8f787
render: draw_underline: use font_baseline() for baseline calculation 2019-08-29 20:42:45 +02:00
Daniel Eklöf
6e5688d7da
render: draw_bar: don't assume height == ascent+descent
Instead, draw a bar that is ascent+descent tall, positioned around the
baseline such that it starts at the ascent and ends at the descent.
2019-08-29 20:41:40 +02:00
Daniel Eklöf
013cf61ffb
render: add font_baseline() - calculates the y-coordinate for the baseline
The old baseline calculation was copy-pasted to a couple of places,
and also assumed that the font's height was equal to ascent+descent.

While this is typically true, it isn't necessarily so.

Now, we assume that height >= ascent+descent, and then position the
baseline in "center" (but adjusted for the descent).
2019-08-29 20:39:22 +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
3ec7fbf0a3
render: remove INFO log (that really was a debug log) 2019-08-29 20:23:44 +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
af8682210e
main: destroy sub-compositor at exit 2019-08-29 20:17:53 +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
2a31c2fbbc
render: reduce amount of dim while searching scrollback history 2019-08-29 19:33:25 +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
242ab66c97
render: double-dim fg+bg when searching the scrollback buffer
By toning down the screen content more, the selection (i.e. the search
match) pops out much more.
2019-08-28 21:53:01 +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
c2b4f4daa6
main: log cell width/height at info level, not debug
This complements the INFO logs from the renderer when the terminal is
resized.
2019-08-28 21:01:36 +02:00
Daniel Eklöf
e932b07423
Merge branch 'master' into scrollback-search 2019-08-28 18:51:01 +02:00
Daniel Eklöf
f1e94aef2c
osc: xparsecolor: parse 'legacy' colors 2019-08-28 17:29:03 +02:00
Daniel Eklöf
551d51bf9d
input: call term_reset_view() instead of duplicating code 2019-08-28 17:28:26 +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
777863ac3e
term: add term_reset_view() - make view follow end-of-output again 2019-08-28 17:27:42 +02:00
Daniel Eklöf
6fa1734468
README: document keyboard shortcuts related to scrollback searching 2019-08-27 21:20:24 +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
58d0657a97
selection: allow selections while searching scrollback 2019-08-27 20:57:58 +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
Daniel Eklöf
c3b5fa82be
search: 'len' is unused in release builds (it's only used in an assert) 2019-08-27 19:58:31 +02:00
Daniel Eklöf
c1bbb64a4d
search: return early after committing a search
This fixes an issue where the selection was finalized, but then
cleared.
2019-08-27 19:56:16 +02:00
Daniel Eklöf
d1974913f7
search: search_update() is always called at end of search_input() 2019-08-27 19:56:02 +02:00
Daniel Eklöf
d518d9dafb
search: don't create a new selection when match start coords haven't changed 2019-08-27 19:55:41 +02:00
Daniel Eklöf
3f767be500
input: cancel search on mouse button events 2019-08-27 19:48:29 +02:00
Daniel Eklöf
43fc297fbd
main: free search buffer 2019-08-27 19:43:50 +02:00
Daniel Eklöf
bb4fd58223
render: don't dim selection while searching 2019-08-27 19:40:07 +02:00
Daniel Eklöf
aee5045395
search: wip: initial search matching
* match search buffer against scrollback content
* adjust view to ensure matched content is visible
* create selection on a successful match
* finalize selection when user presses enter (to "commit" the search)
* ctrl+r searches for the next match. Needs more work though.
2019-08-27 19:33:19 +02:00
Daniel Eklöf
61cabdac13
search: wip: re-direct input while searching, and build a search buffer
This adds a new state, 'is_searching'. While active, input is
re-directed, and stored in a search buffer. In the future, we'll use
this buffer and search for its content in the scrollback buffer, and
move the view and create a selection on matches.

When rendering in 'is_searching', everything is dimmed. In the future,
we'll render the current search buffer on-top of the dimmed "regular"
terminal output.
2019-08-27 17:23:28 +02:00
Daniel Eklöf
2d7ca416f0
render: center grid in window
Instead of placing the upper left corner of the grid at 0,0 in the
window, center it.
2019-08-27 15:25:35 +02:00
Daniel Eklöf
382bea8309
vt: tidy lazy initialization of escape parameters 2019-08-27 15:24:49 +02:00
Daniel Eklöf
936526ed5b
vt: no need to reset OSC string in CLEAR action
... as this is done when a new OSC string is started
2019-08-27 15:24:19 +02:00
Daniel Eklöf
8d65f45bf5
vt: store alt charset characters as wchars 2019-08-27 15:23:50 +02:00
Daniel Eklöf
0c5a19f950
vt: bug: fix lazy initialization of sub parameter value (off-by-one) 2019-08-24 11:39:28 +02:00
Daniel Eklöf
9b74cedb20
vt: clear CSI parameters lazily
The CLEAR action is so common, that explicitly clearing the entire
params array, which is kind of big, is too slow.

Clear it lazily instead. Meaning, we only set 'idx' (count) to 0 in
CLEAR. Then whenever we parse a parameter, clear the value and sub
parameters.
2019-08-24 11:33:13 +02:00
Daniel Eklöf
dcf6d18872
render: log frame rendering time with microseconds instead of milliseconds 2019-08-24 11:32:28 +02:00