aboutsummaryrefslogtreecommitdiff
path: root/search.c (follow)
Commit message (Collapse)AuthorAgeLines
...
* search: improve viewport movementsDaniel Eklöf2020-07-24-32/+46
| | | | | | * Don't move the viewport if the new match is already fully visible * When we do have to move the viewport, position it such that the new match ends up roughly in the middle.
* search: re-enable search-commit actionDaniel Eklöf2020-07-22-7/+5
| | | | | This was disabled while implementing multi-seat support, and I forgot to fix and re-enable before that feature was merged.
* multi-seat: re-enable scrollback search supportDaniel Eklöf2020-07-08-23/+12
|
* wip: multi-seat supportDaniel Eklöf2020-07-08-5/+18
| | | | | Compiles and runs, but mouse, clipboard and other things have been disabled.
* util.h: new header file defining commonly used macrosDaniel Eklöf2020-05-01-2/+1
|
* misc: replace all explicit zero-initializers with empty initializersDaniel Eklöf2020-04-13-1/+1
|
* mbstate: fix compile warning on systems where mbstate_t isn't an integralDaniel Eklöf2020-04-13-1/+1
| | | | | An empty initializer still ensures the entire object is zero-initialized.
* search: replace hard-coded key bindings with "user configurable" onesDaniel Eklöf2020-03-18-113/+115
| | | | | | | | They aren't really user configurable. At least not yet. However, with this, we now handle raw key codes just like the normal key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while searching with e.g. a russian layout.
* input: bindings: don't match raw key code alone - mods must also matchDaniel Eklöf2020-03-18-1/+4
|
* input: bind key bindings to raw key codes tooDaniel Eklöf2020-03-18-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Before, when looking for a matching user key binding, we only matched *symbols*. This means that the physical keys that generate a specific key binding is layout dependent. What's worse, it may not even be possible to generate the key binding at all. Russian is one such layout, where all the "normal" (us) symbols are replaced. By using raw key codes, we can get around this - the key code has a direct mapping to the physical key. However, matching raw key codes **only** doesn't always make sense either. For now, match **both** symbols _and_ key codes. Symbols take precedence. TODO: we might have to make this configurable _per binding_. Note: 'search' mode still uses mostly hardcoded shortcuts that still have this problem (i.e. ctrl+g doesn't work with a russian layout).
* search: add support for user configurable key bindingsDaniel Eklöf2020-03-08-1/+13
| | | | No default bindings defined yet, though.
* render: never render CSD and/or search box "immediately"Daniel Eklöf2020-03-06-4/+2
| | | | | | | | | | Handle the CSDs and the search box the same way we handle the main grid; when we need to redraw them, call render_refresh_{csd,search}(). This sets a flag that is checked after each FDM iteration. All actual rendering is done here. This also ties the commits of the Wayland sub-surfaces to the commit of the main surface.
* search: don't mark the entire sub-surface as opaqueDaniel Eklöf2020-03-01-5/+0
|
* search: enable/disable weston sub-surface desync quirk when rendering search boxDaniel Eklöf2020-03-01-1/+1
|
* search: update search box before we update the main gridDaniel Eklöf2020-03-01-1/+1
|
* wayland: store pointer to window instance in all surfacesDaniel Eklöf2020-02-29-0/+2
|
* wayland: instantiate sub-surfaces on-demandDaniel Eklöf2020-02-26-2/+21
| | | | | | | | | | | | | | | | | | | While most compositors handle instantiated but not-yet-mapped sub-surfaces correctly, e.g. kwin does not. For example, it will incorrectly offset the main surface both horizontally and vertically with a couple of pixels, leaving two transparent areas at the top and left, between the SSDs and the main surface. Note that a workaround is to position the sub-surfaces inside the main surface while they're unmapped. However, since the surfaces may be larger than the main surface (the CSDs, for examples, always are), this doesn't quite work since kwin, at least, resizes the window to include the sub-surfaces, even when unmapped. So, instead we instantiate all sub-surfaces on demand, when we know where to position them, and when they should be mapped.
* search: rename render.search_offset -> render.search_glyph_offsetDaniel Eklöf2020-01-05-1/+1
|
* render: ensure cursor is always visible in the search boxDaniel Eklöf2020-01-05-0/+1
| | | | | | | | | | | | | | | | | | Maintain a view 'offset' (which glyph from the search string to start rendering at). This defines the start of the viewable area. The end is the offset + the search box size (which is limited to the window size). Adjust this offset whenever the cursor moves outside the viewable area. For now, this is always done in the same way: set the offset to the cursor position. This means that when we're entering text at the end of the search criteria (i.e. the normal case; we're simply typing), and the search box reaches the window size, the cursor will jump to the start of the search box, which will be empty. This could be confusing, but let's go with for now.
* selection: track selection type; normal or block selectionDaniel Eklöf2020-01-03-1/+1
|
* search: match_to_end_of_word: reset end_col when done with a rowDaniel Eklöf2019-12-03-0/+2
|
* search: match_to_end_of_word: bug: reset end-col when bumping end-rowDaniel Eklöf2019-12-03-1/+3
| | | | | | | | 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.
* search: bug: restore end-col/end-row adjustmentDaniel Eklöf2019-12-03-2/+4
| | | | | Turns out end_col *can* be exactly 0. In this case, we need to adjust the end-row too.
* search: bug: re-initialize start-row when attempting a new matchDaniel Eklöf2019-12-03-4/+4
| | | | | | 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.
* search: map ctrl+shift+w to match to end of word, spaces onlyDaniel Eklöf2019-12-03-4/+7
| | | | | This works just like ctrl+w, except that the only space separating characters are whitespaces.
* search: search_match_to_end_of_word: rename start_{row,col} -> end_{row,col}Daniel Eklöf2019-12-03-8/+10
|
* search: split up search_update() into twoDaniel Eklöf2019-12-03-68/+71
| | | | | | | | | * 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.
* search: rename search_update() -> search_find_next()Daniel Eklöf2019-12-03-3/+3
|
* search: map ctrl+w to 'extend current selection to end of word'Daniel Eklöf2019-12-03-0/+75
| | | | | | | 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.
* search: discard canceled compose sequencesDaniel Eklöf2019-12-03-0/+2
|
* Revert "search: discard canceled compose sequences"Daniel Eklöf2019-12-03-4/+0
| | | | This reverts commit f67733c0e3a4e4ba19e1c70bc36ee78af762868f.
* search: discard canceled compose sequencesDaniel Eklöf2019-12-03-0/+4
|
* search: remove debug logDaniel Eklöf2019-12-03-1/+0
|
* search: don't line-wrap unless we actually have a match on the next rowDaniel Eklöf2019-12-03-4/+6
| | | | | | | | 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.
* search: break out search buffer resize code to a new functionDaniel Eklöf2019-12-03-12/+21
|
* Add missing includesDaniel Eklöf2019-12-01-0/+1
|
* search: update xcursor when starting and ending a searchDaniel Eklöf2019-11-29-0/+2
|
* wayland: implement wayl_init()Daniel Eklöf2019-10-27-2/+2
| | | | Wayland instantiation is now done by the wayland backend, not in main.
* term: wayland struct is now not a part of the terminal structDaniel Eklöf2019-10-27-9/+9
| | | | | | 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.
* wayland: change all wayland callbacks to take a wayland pointerDaniel Eklöf2019-10-27-1/+1
| | | | | Instead of passing the terminal to the wayland callbacks, pass a 'struct wayland' pointer.
* kbd: move into waylandDaniel Eklöf2019-10-27-8/+8
|
* term: move per-window wayland objects from wayland struct to terminal structDaniel Eklöf2019-10-27-2/+2
| | | | | | | | 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.
* search: map ctrl+b/f to move cursor single character backward/forwardDaniel Eklöf2019-08-30-2/+6
|
* search: ctrl+s searches forwardDaniel Eklöf2019-08-30-0/+18
|
* search: make search-direction configurableDaniel Eklöf2019-08-30-7/+23
|
* search: fix distance to prev word calculation when final cursor was 0Daniel Eklöf2019-08-30-1/+1
|
* search: implement move cursor word backward/forwardDaniel Eklöf2019-08-30-0/+18
|
* search: implement delete word backward/forwardDaniel Eklöf2019-08-30-2/+18
|
* search: utility functions distance_{next,prev}_word()Daniel Eklöf2019-08-30-0/+56
| | | | | These functions calculate the distance from the current cursor to the next/previous word.
* Revert "search: for now, reset search match state whenever the buffer changes"Daniel Eklöf2019-08-29-9/+0
| | | | This reverts commit 9c6ece747ed328b0e922597ec52646c00bb68c8c.
* search: for now, reset search match state whenever the buffer changesDaniel Eklöf2019-08-29-0/+9
|
* search: call render_search_box() from search_inptu()Daniel Eklöf2019-08-29-3/+1
|
* search: add basic cursor navigation supportDaniel Eklöf2019-08-29-2/+45
|
* search: insert new characters at cursor, not at the end of the bufferDaniel Eklöf2019-08-29-2/+7
|
* search: search_cancel: reset cursor positionDaniel Eklöf2019-08-29-0/+1
|
* search: turn info log to a debug logDaniel Eklöf2019-08-29-1/+1
|
* search: remove INFO log (that really was a debug log)Daniel Eklöf2019-08-29-1/+0
|
* search: don't destroy/recreate search (sub)surfaceDaniel Eklöf2019-08-29-27/+2
| | | | | | 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).
* search: move render() function to the 'render' moduleDaniel Eklöf2019-08-29-80/+4
|
* search: move wayland surface variables into the term structDaniel Eklöf2019-08-29-24/+23
|
* search: use a sub-surface to render the search bufferDaniel Eklöf2019-08-29-14/+135
|
* search: cancel existing selection when starting a new searchDaniel Eklöf2019-08-28-0/+1
|
* search: log search buffer at INFO levelDaniel Eklöf2019-08-28-1/+1
| | | | ... until we actually render the search buffer somehow
* search: fix start/end row in selectionDaniel Eklöf2019-08-28-2/+16
|
* search: start search in current view, rather than from end-of-outputDaniel Eklöf2019-08-28-2/+4
|
* search: match case insensitiveDaniel Eklöf2019-08-27-2/+2
|
* search: sort includesDaniel Eklöf2019-08-27-1/+1
|
* search: disable log outputDaniel Eklöf2019-08-27-1/+1
|
* search: loop through the *entire* scrollback bufferDaniel Eklöf2019-08-27-2/+7
|
* search: cancel selection and clear match stats when we don't matchDaniel Eklöf2019-08-27-0/+5
|
* search: 'len' is unused in release builds (it's only used in an assert)Daniel Eklöf2019-08-27-1/+1
|
* search: return early after committing a searchDaniel Eklöf2019-08-27-0/+1
| | | | | This fixes an issue where the selection was finalized, but then cleared.
* search: search_update() is always called at end of search_input()Daniel Eklöf2019-08-27-1/+0
|
* search: don't create a new selection when match start coords haven't changedDaniel Eklöf2019-08-27-2/+8
|
* search: wip: initial search matchingDaniel Eklöf2019-08-27-1/+168
| | | | | | | | * 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.
* search: wip: re-direct input while searching, and build a search bufferDaniel Eklöf2019-08-27-0/+107
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.