aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/picker.rs
Commit message (Collapse)AuthorAge
* support toggling pickers' preview panel (#3021)Bob2022-07-18
| | | | | * support toggling pickers' preview panel * add doc for toggling preview
* Add live preview to theme picker (#1798)Joe2022-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add theme picker with live preview * Add live theme preview to :theme command * cargo fmt * Fix clippy warnings * Remove picker variant * Remove unused import * Cleanup * Change current_theme to last_theme * Fix accidental comment flash deletion * Typo * Remove theme cache * Add some comments * Refactor some theme handling TIL flatmap on Option is called and_then * Remove unnecessary renames * Constrain last_theme theme preview lifecycle * Switch to bitflag implementation * Better handling of last_theme * Sort theme names * Better memory juggling * Missed a branch * Remove name from theme, switch bitand to & * cargo fmt * Update helix-view/src/editor.rs * Switch boolean to enum * Remove bitflag impl * cargo fmt * Remove un-needed type arg * cargo fmt
* Highlight whole row in picker menus (#2939)ChrHorn2022-07-02
|
* Reuse menu::Item trait in picker (#2814)Gokul Soumya2022-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor menu::Item to accomodate external state Will be useful for storing editor state when reused by pickers. * Add some type aliases for readability * Reuse menu::Item trait in picker This opens the way for merging the menu and picker code in the future, since a picker is essentially a menu + prompt. More excitingly, this change will also allow aligning items in the picker, which would be useful (for example) in the command palette for aligning the descriptions to the left and the keybinds to the right in two separate columns. The item formatting of each picker has been kept as is, even though there is room for improvement now that we can format the data into columns, since that is better tackled in a separate PR. * Rename menu::Item::EditorData to Data * Call and inline filter_text() in sort_text() completion * Rename diagnostic picker's Item::Data
* Add workspace and document diagnostics picker (#2013)Falco Hirschenberger2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add workspace and document diagnostics picker fixes #1891 * Fix some of @archseer's annotations * Add From<&Spans> impl for String * More descriptive parameter names. * Adding From<Cow<str>> impls for Span and Spans * Add new keymap entries to docs * Avoid some clones * Fix api change * Update helix-term/src/application.rs Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com> * Fix a clippy hint * Sort diagnostics first by URL and then by severity. * Sort diagnostics first by URL and then by severity. * Ignore missing lsp severity entries * Add truncated filepath * Typo * Strip cwd from paths and use url-path without schema * Make tests a doctest * Better variable names Co-authored-by: Falco Hirschenberger <falco.hirschenberger@itwm.fraunhofer.de> Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com>
* Refactor Margin for fine grained control (#2727)Gokul Soumya2022-06-21
|
* Make indent guides configurableGokul Soumya2022-06-21
|
* Bump dependencies, allow retain_mut for nowBlaž Hrastnik2022-05-29
|
* Add theme key for picker separator (#2523)kyrime2022-05-22
| | | Co-authored-by: ky <>
* address rust 1.61.0 clippy lints (#2514)Michael Davis2022-05-20
|
* allow whitespace to be renderedOmnikar2022-04-20
| | | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Resolve conflicts between prompt/picker bindings (#1792)Rohan Jain2022-03-31
| | | | | | | | | | | | | | Currently, the picker's re-using a few bindings which are also present in the prompt. This causes some editing behaviours to not function on the picker. **Ctrl + k** and **Ctrl + j** This should kill till the end of the line on prompt, but is overridden by the picker for scrolling. Since there are redundancies (`Ctrl + p`, `Ctrl + n`), we can remove it from picker. **Ctrl + f** and **Ctrl + b** This are used by the prompt for back/forward movement. We could modify it to be Ctrl + d and Ctrl + u, to match the `vim` behaviour.
* Make truncate_start a builder method insteadBlaž Hrastnik2022-03-28
|
* Make line a private propertyBlaž Hrastnik2022-03-28
|
* This doesn't need to be mutBlaž Hrastnik2022-03-28
|
* Handle panic on move within empty picker (#1786)Rohan Jain2022-03-14
| | | | | | | | | When the picker results output is empty, movement actions result in a panic: ``` thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', helix-term/src/ui/picker.rs:420:31 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` This could be a no-op instead when the matches length is zero.
* Picker performance improvementsBlaž Hrastnik2022-03-03
|
* Highlight matching text in file picker suggestions (#1635)Ludwig Stecher2022-03-01
| | | | | | | * Highlight matching text in file picker suggestions * Remove cache, specialize highlighting code * Fix outdated comments
* Close some popups automatically (#1285)Bram2022-02-23
| | | | | | | | | | | | | | | | | | | * Add Event::Used to use event callback without consuming * Close popup if contents ignored event * collect event results before executing callbacks * don't add new result variant, use Ignored(..) instead * break in match cases * Make auto_close configurable * fix merge * auto close hover popups * fix formatting
* Extract a helper function for lsp::LocationBlaž Hrastnik2022-02-18
|
* Pass through Editor instead of ContextBlaž Hrastnik2022-02-17
|
* helix-term: implement buffer completerCole Helbling2022-02-17
| | | | | | In order to implement this completer, the completion function needs to be able to access the compositor's context (to allow it to get the list of buffers currently open in the context's editor).
* Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard ↵Ludwig Stecher2022-02-15
| | | | | | | | | | | | | | | shortcuts to file picker (#1612) * Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker * Refactor file picker paging logic * change key mapping * Add overlay component * Use closure instead of margin to calculate size * Don't wrap file picker in `Overlay` automatically
* Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2022-02-13
|\
| * Improve code action picker by displaying it inlineBlaž Hrastnik2022-01-31
| |
| * Fix picker won't scroll down when it hits the bottom #1544 (#1567)Benjamin2022-01-23
| |
| * Store theme scopes on the loader, this way theme isn't passed aroundBlaž Hrastnik2022-01-23
| |
| * syntax: Split parsing and highlightingBlaž Hrastnik2022-01-23
| |
| * Fix panics when resizing (#1408)Mathis Brossier2022-01-16
| | | | | | | | | | | | | | | | | | | | | | * Change buffer.get & buffer.get_mut to return Option, Implement Trait Index & IndexMut to panic * Prevent FilePicker from drawing outside buffer (rust panics) * apply suggestion * add function in_bounds to avoid useless calculations Co-authored-by: mathis <mathis.brossier@universite-paris-saclay.fr>
| * Macros (#1234)Omnikar2021-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Macros WIP `helix_term::compositor::Callback` changed to take a `&mut Context` as a parameter for use by `play_macro` * Default to `@` register for macros * Import `KeyEvent` * Special-case shift-tab -> backtab in `KeyEvent` conversion * Move key recording to the compositor * Add comment * Add persistent display of macro recording status When macro recording is active, the pending keys display will be shifted 3 characters left, and the register being recorded to will be displayed between brackets — e.g., `[@]` — right of the pending keys display. * Fix/add documentation
| * fix: Normalize backtab into shift-tabBlaž Hrastnik2021-12-06
| | | | | | | | Fixes #1150
| * Bump rust to 1.57, fix new lint failuresBlaž Hrastnik2021-12-03
| |
* | dap: Remove the prompt line parameter, use insert_str insteadBlaž Hrastnik2021-11-22
| |
* | Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2021-11-21
|\|
| * Added workspace_symbol_picker (#1041)Ebbe Steenhoudt2021-11-14
| | | | | | | | | | | | | | * Added workspace_symbol_picker * Moved truncation of the symbol pickers to the end. * Fixed typo
| * fix: shift-tab mappings broken after efc2b4c7Blaž Hrastnik2021-11-12
| |
| * Refactor keyevent handling using key, ctrl macros (#1058)Gokul Soumya2021-11-10
| | | | | | | | | | | | Adds ctrl! and alt! macros (which existed before the big keymap refactor) and uses them in event handling of Components. Note that this converts crossterm's KeyEvent to our own KeyEvent on each invocation of handle_event in Components.
* | Make picker take the whole context, not just editorBlaž Hrastnik2021-11-07
| |
* | Merge branch 'master' into debugBlaž Hrastnik2021-11-06
|\|
| * Prevent preview binary or large file (#939)diegodox2021-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prevent preview binary or large file (#847) * fix wrong method name * fix add use trait * update lock file * rename MAX_PREVIEW_SIZE from MAX_BYTE_PREVIEW * read small bytes to determine cotent type * [WIP] add preview struct to represent calcurated preveiw * Refactor content type detection - Remove unwraps - Reuse a single read buffer to avoid 1kb reallocations between previews * Refactor preview rendering so we don't construct docs when not necessary * Replace unwarap whit Preview::NotFound * Use index access to hide unwrap Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * fix Get and unwarp equivalent to referce of Index acess * better preview implementation * Rename Preview enum and vairant Co-authored-by: Gokul Soumya <gokulps15@gmail.com> * fixup! Rename Preview enum and vairant * simplify long match * Center text, add docs, fix formatting, refactor Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
| * Truncate the starts of file paths instead of the ends in picker (#951)Omnikar2021-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | * Truncate the starts of file paths in picker * Simplify the truncate implementation * Break loop at appropriate point * Fix alignment and ellipsis presence * Remove extraneous usage of `x_offset` Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
| * Add commands for moving between splits with a direction (#860)Oskar Nehlin2021-10-23
| | | | | | | | | | | | | | | | | | * Add commands for moving between splits with a direction * Update keymaps * Change picker mapping * Add test and clean up some comments
| * Update to rust 1.56 + 2021 editionBlaž Hrastnik2021-10-22
| |
| * Add `C-j` and `C-k` to keybinds for picker (#876)VuiMuich2021-10-19
| | | | | | | | | | * Add `C-j` and `C-k` for moving down/up in pickers * Add new binds to keymap doc
* | Merge branch 'master' into debugBlaž Hrastnik2021-10-17
|\|
| * Picker: Don't panick at move_up/move_down when matches is empty (#818)Leoi Hung Kin2021-10-09
| |
* | Merge branch 'master' into debugDmitry Sharshakov2021-09-25
|\|
| * fix: Wrap around the top of the picker menu when scrollingBlaž Hrastnik2021-09-17
| | | | | | | | | | | | Forgot to port the improvements in menu.rs Fixes #734
| * ui: Be smarter about centering previewsBlaž Hrastnik2021-09-08
| | | | | | | | | | Try centering the whole block. If the block is too big for the viewport, then make sure that the first line is within the preview.
* | Normalize line in picker preview to avoid crashDmitry Sharshakov2021-09-05
| |