Commit Graph

892 Commits (f659e1178a20cfaa151eaf62af3135a233272151)

Author SHA1 Message Date
Blaž Hrastnik f659e1178a minor: view!(..).doc is slightly more efficient than current!(..).1.id() 3 years ago
Blaž Hrastnik 4c1321b3b6 minor: Extend search was decclared twice in the keymap 3 years ago
Blaž Hrastnik b81a554424 Retain range direction on search
Co-authored-by: CossonLeo <20379044+cossonleo@users.noreply.github.com>
3 years ago
Blaž Hrastnik 6431b26a6a Implement Selection::replace to replace a single range
Fixes #985

Co-authored-by: Daniel S Poulin <crimsonmage+github@gmail.com>
3 years ago
Gygaxis Vainhardt 911b9b3276
Add reverse search functionality (#958)
* Add reverse search functionality

* Change keybindings for extend to be in select mode, incorporate Movement and Direction enums

* Fix accidental revert of #948 in rebase

* Add reverse search to docs, clean up mismatched whitespace

* Reverse search optimization

* More optimization via github feedback
3 years ago
Omnikar cfc8285867
Allow infoboxes to be disabled (#972)
* Allow infoboxes to be disabled

* Document `infoboxes` default value

* Rename `infoboxes` to `auto_info`

* Document `auto-info`

* Fix incomplete rename
3 years ago
Omnikar 51b4d35dce
Inform when reaching undo/redo bounds (#981)
* Inform when reaching undo/redo bounds

* `Already at oldest change` when undo fails
* `Already at newest change` when redo fails

* Add missing `the`
3 years ago
Blaž Hrastnik 7b65a6d687 Rewrite goto_buffer 3 years ago
ath3 78c68fae91 Implement "Goto next buffer / Goto previous buffer" commands 3 years ago
Blaž Hrastnik e2560f427e Replace documents SlotMap with BTreeMap 3 years ago
CossonLeo 39584cbccd
Add c-s to pick word under doc cursor to prompt line & search completion (#831)
* Add prompt shourtcut to book
Add completions to search
Add c-s to pick word under doc cursor to prompt line

* limit 20 last items of search completion, update book

* Update book/src/keymap.md

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* limit search completions 200

Co-authored-by: Ivan Tham <pickfire@riseup.net>
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
Omnikar e39cfa40df
Hide keys bound to `no_op` from infobox (#971) 3 years ago
Ivan Tham 3eb829e233
Ensure coords in screen depends on char width (#885)
The issue affected files with lots of tabs at the start as well.

Fix #840
3 years ago
Triton171 7a0c4322ea Simplify BTreeSet construction
Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years ago
Daniel Ebert eb8745db09 Implement key ordering for info box 3 years ago
CossonLeo 1720b98760
only remove primary index when search next without extend (#948) 3 years ago
Gygaxis Vainhardt f140a2a00e
Add arrow-key bindings for window switching (#933) 3 years ago
Blaž Hrastnik e5de103728 Extract a clear_completion method 3 years ago
Ivan Tham 49f6c2623f
Bump lsp-types to 0.91.0 (#932) 3 years ago
Ivan Tham bc6a34d97e
Make match work with extend and multi cursors (#920) 3 years ago
Ivan Tham 21d535565b
Support extend for multiple goto (#909)
gg, ge, [n]gg
3 years ago
cossonleo f1d339919f add expand_selection to last_motion 3 years ago
Omnikar db56de589a
Add `--tutor` option to `hx --help` output (#924)
* Add `--tutor` option to `hx --help` output

* Adjust `--tutor` location in help output
3 years ago
Omnikar e2ed691537
Implement `hx --tutor` and `:tutor` to load `tutor.txt` (#898)
* Implement `hx --tutor` and `:tutor` to load `tutor.txt`

* Document `hx --tutor` and `:tutor`

* Change `Document::set_path` to take an `Option`

* `Document::set_path` accepts an `Option<&Path>` instead of `&Path`.
* Remove `Editor::open_tutor` and make tutor-open functionality use
  `Editor::open` and `Document::set_path`.

* Use `PathBuf::join`

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* Add comments explaining unsetting tutor path

Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years ago
Nehliin 3b0c5e993a Use deserialization fix instead 3 years ago
Oskar Nehlin 6e455fd3fb Apply suggestions from code review
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
3 years ago
Nehliin da4d9340ba Make key macro more portable 3 years ago
Nehliin a4c5f46739 Fix order being empty and add test 3 years ago
Nehliin f133d80e70 Move test to test module 3 years ago
Nehliin fbba47fbc0 Fix panic when using multi-level key mapping 3 years ago
Blaž Hrastnik 1066b081dd fix: When cycling through prompt history, update event needs to trigger 3 years ago
Omnikar 2505802d39
Improve statusline (#916)
* Improve statusline

* Change diagnostic count display to show counts of individual
  diagnostic types next to their corresponding gutter dots.
* Add selection count to the statusline.

* Do not display info or hint count in statusline

* Reduce padding

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* Reduce padding

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* Use `Span::styled`

* Reduce padding

* Use `Style::patch`

* Remove unnecessary `Cow` creation

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
3 years ago
radical3dd d61e5e686b
Use current dir for file picker, after change dir. (#910) 3 years ago
CossonLeo f331ba9df4
Clear competion items when start_offset > cursor (#906) 3 years ago
CossonLeo b142fd4080
move_up will select last item, when no item selected (#907) 3 years ago
CossonLeo bca98b5bed
Add c-j c-k to menu keymap for move_up move_down (#908) 3 years ago
Blaž Hrastnik acc5ac5e73 fix warning 3 years ago
Blaž Hrastnik 3edca7854e completion: fully revert state before apply & insertText common prefix 3 years ago
Omnikar a7d87c79ce
Fix `:quit!` description and tense of other commands (#902) 3 years ago
CossonLeo 2ed01f2d9c
find motion and textobj motion repeat (#891) 3 years ago
Blaž Hrastnik cee7ad781e Mark a few functions as `const` 3 years ago
CossonLeo 971ba8929f
Filter completion items from language server by starts_with word under cursor (#883)
* filter items by starts_with pre nth char of cursor

* add config for filter completion items by starts_with

* filter items by starts_with pre nth char of cursor

* add config for filter completion items by starts_with

* remove completion items pre filter configuratio
3 years ago
Kirawi 0cb5e0b2ca
log syntax highlighting init errors (#895) 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
Gokul Soumya 4ee92cad19
Add treesitter textobjects (#728)
* Add treesitter textobject queries

Only for Go, Python and Rust for now.

* Add tree-sitter textobjects

Only has functions and class objects as of now.

* Fix tests

* Add docs for tree-sitter textobjects

* Add guide for creating new textobject queries

* Add parameter textobject

Only parameter.inside is implemented now, parameter.around
will probably require custom predicates akin to nvim' `make-range`
since we want to select a trailing comma too (a comma will be
an anonymous node and matching against them doesn't work similar
to named nodes)

* Simplify TextObject cell init
3 years ago
Blaž Hrastnik 96945be1a8 Fix doctest broken on 2021 edition 3 years ago
Blaž Hrastnik 182a59b552 Update to rust 1.56 + 2021 edition 3 years ago
Daniel S Poulin 3b032e8e1f
First stab at ignoring compressed files from picker (#767) 3 years ago