Commit Graph

78 Commits (c15996aff597aa8cb63850c6080bc69470bb84a5)

Author SHA1 Message Date
Bram 40eb1268c7
Close some popups automatically (#1285)
* 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
2 years ago
Blaž Hrastnik c06155ace4 Extract a helper function for lsp::Location 2 years ago
Blaž Hrastnik af21e2a5b4 Pass through Editor instead of Context 2 years ago
Cole Helbling 6118486eb2 helix-term: implement buffer completer
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).
2 years ago
Ludwig Stecher 4429993842
Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard 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
2 years ago
Blaž Hrastnik bd549d8a20 Merge remote-tracking branch 'origin/master' into debug 2 years ago
Blaž Hrastnik f7f55143a1 Improve code action picker by displaying it inline 2 years ago
Benjamin 4044c70eb2
Fix picker won't scroll down when it hits the bottom #1544 (#1567) 2 years ago
Blaž Hrastnik 53d881f172 Store theme scopes on the loader, this way theme isn't passed around 2 years ago
Blaž Hrastnik 6728e44490 syntax: Split parsing and highlighting 2 years ago
Mathis Brossier f5b0821860
Fix panics when resizing (#1408)
* 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>
2 years ago
Omnikar e91d357fae
Macros (#1234)
* 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
3 years ago
Blaž Hrastnik cab09093dd fix: Normalize backtab into shift-tab
Fixes #1150
3 years ago
Blaž Hrastnik 34f46e7502 Bump rust to 1.57, fix new lint failures 3 years ago
Blaž Hrastnik 0eadeab8c7 dap: Remove the prompt line parameter, use insert_str instead 3 years ago
Blaž Hrastnik d1854d8e6a Merge remote-tracking branch 'origin/master' into debug 3 years ago
Ebbe Steenhoudt edc976b6bb
Added workspace_symbol_picker (#1041)
* Added workspace_symbol_picker

* Moved truncation of the symbol pickers to the end.

* Fixed typo
3 years ago
Blaž Hrastnik d3def16584 fix: shift-tab mappings broken after efc2b4c7 3 years ago
Gokul Soumya efc2b4c77b
Refactor keyevent handling using key, ctrl macros (#1058)
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.
3 years ago
Blaž Hrastnik 3b8d5102ac Make picker take the whole context, not just editor 3 years ago
Blaž Hrastnik f2b709a3c3 Merge branch 'master' into debug 3 years ago
diegodox 70d21a903f
Prevent preview binary or large file (#939)
* 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>
3 years ago
Omnikar 5b5d1b9dff
Truncate the starts of file paths instead of the ends in picker (#951)
* 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>
3 years ago
Oskar Nehlin 0f886af4b9
Add commands for moving between splits with a direction (#860)
* Add commands for moving between splits with a direction

* Update keymaps

* Change picker mapping

* Add test and clean up some comments
3 years ago
Blaž Hrastnik 182a59b552 Update to rust 1.56 + 2021 edition 3 years ago
VuiMuich 67829976fa
Add `C-j` and `C-k` to keybinds for picker (#876)
* Add `C-j` and `C-k` for moving down/up in pickers

* Add new binds to keymap doc
3 years ago
Blaž Hrastnik 0a6b60085a Merge branch 'master' into debug 3 years ago
Leoi Hung Kin a6852fb88f
Picker: Don't panick at move_up/move_down when matches is empty (#818) 3 years ago
Dmitry Sharshakov bf53aff27d Merge branch 'master' into debug 3 years ago
Blaž Hrastnik c7d6e4461f fix: Wrap around the top of the picker menu when scrolling
Forgot to port the improvements in menu.rs

Fixes #734
3 years ago
Blaž Hrastnik 2ce87968cd ui: Be smarter about centering previews
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.
3 years ago
Dmitry Sharshakov 2d35b7b99c
Normalize line in picker preview to avoid crash 3 years ago
Dmitry Sharshakov 1befbd076c Add command for editing breakpoint condition 3 years ago
Blaž Hrastnik a3bd80a6fa ui: prompt: Avoid allocating a prompt name if it's a static string 3 years ago
Kirawi b99db7c687
Move path util functions from helix-term to helix-core (#650) 3 years ago
Blaž Hrastnik bf5b9a9f35 ui: Tone down the preview highlight by adding a new scope 3 years ago
Blaž Hrastnik e6cb183134 ui: Fix preview window padding: we want horizontal, not vertical 3 years ago
Blaž Hrastnik a5c3c6c6a9 ui: Highlight line ranges in the preview 3 years ago
Gokul Soumya f9375f449c
Refactor new Rect construction (#575)
* Refactor new Rect construction

Introduces methods that can be chained to construct new Rects
out of pre-existing ones

* Clamp x and y to edges in Rect chop methods

* Rename Rect clipping functions
3 years ago
Kirawi da8810809a use `ui.text.focus` for the picker (fix #622) 3 years ago
Blaž Hrastnik 4167201344 ui: picker: Position count according to input bar 3 years ago
Blaž Hrastnik eb9ac0a743 ui: picker: Use ui.selection instead of ui.selection.primary 3 years ago
Blaž Hrastnik f20dc1283d ui: picker: Render matches/total counts 3 years ago
Gokul Soumya d84f8b5fde
Show file preview in split pane in fuzzy finder (#534)
* Add preview pane for fuzzy finder

* Fix picker preview lag by caching

* Add picker preview for document symbols

* Cache picker preview per document instead of view

* Use line instead of range for preview doc

* Add picker preview for buffer picker

* Fix render bug and refactor picker

* Refactor picker preview rendering

* Split picker and preview and compose

The current selected item is cloned on every event, which is
undesirable

* Refactor out clones in previewed picker

* Retrieve doc from editor if possible in filepicker

* Disable syntax highlight for picker preview

Files already loaded in memory have syntax highlighting enabled

* Ignore directory symlinks in file picker

* Cleanup unnecessary pubs and derives

* Remove unnecessary highlight from file picker

* Reorganize buffer rendering

* Use normal picker for code actions

* Remove unnecessary generics and trait impls

* Remove prepare_for_render and make render mutable

* Skip picker preview if screen small, less padding
3 years ago
Blaž Hrastnik 63e54e30a7 Implement in-memory prompt history
Implementation is similar to kakoune: we store the entries into
a register.
3 years ago
Ivan Tham eba0bbda2e Resume last picker
Inspired by space ' in doom emacs.
3 years ago
Nathan Vegdahl efa3389b6a Fix unused variable, parameter, and `mut` warnings in helix-term. 3 years ago
Keith Simmons 4418e17547
reverse the dependency between helix-tui and helix-view (#366)
* reverse the dependency between helix-tui and helix-view by moving a fiew types to view

* fix tests

* clippy and format fixes

Co-authored-by: Keith Simmons <keithsim@microsoft.com>
3 years ago
Gokul Soumya 18beda38ac Add … when chars are truncated in picker 3 years ago
Gokul Soumya fb8e7dc25b Fix picker item width overflow
Fixes #352
3 years ago