Commit Graph

1126 Commits (72576822f31ee2e2f88a1b627b0f5c14dc66ec37)

Author SHA1 Message Date
Omnikar a424ef4e20
Use default `languages.toml` if user's is invalid (#994) 2021-11-09 11:07:54 +09:00
CossonLeo 29e6849413
Add LSP rename_symbol (space-r) (#1011)
improve apply_workspace_edit
2021-11-09 00:17:54 +09:00
Blaž Hrastnik 8b85903116 wip 2021-11-08 10:03:08 +09:00
Omnikar a252ecd8c8
Add WORD textobject (#991)
* Add WORD textobject

* Document WORD textobject
2021-11-08 09:54:39 +09:00
Blaž Hrastnik 09f5796537 dap: Simplify get_breakpoint_at_current_line 2021-11-07 22:03:55 +09:00
Blaž Hrastnik c39d9f44a0 dap: Simplify debug_parameter_prompt 2021-11-07 21:58:06 +09:00
Blaž Hrastnik 3042ff3e5a dap: Clean up dap_start_impl, no need to clone arg keys 2021-11-07 21:47:44 +09:00
Blaž Hrastnik 9963a5614d dap: Minor simplifications 2021-11-07 21:37:00 +09:00
Blaž Hrastnik 65868081fc dap: Simplify launch & start
There's no need to re-detect language config, just use the one available
on the document.
2021-11-07 21:26:03 +09:00
Blaž Hrastnik 4f2a01cc09 dap: Error implements Display so we can format with {} 2021-11-07 21:20:58 +09:00
Blaž Hrastnik 2bd8a9b39d dap: Consistently rename type as ty 2021-11-07 21:18:53 +09:00
Blaž Hrastnik 9dd17c46a2 dap: Avoid cloning old_breakpoints if we are immediately replacing them 2021-11-07 18:58:47 +09:00
Blaž Hrastnik 757babb1b4 dap: Avoid cloning *entire* stack frames when picking a thread 2021-11-07 18:56:09 +09:00
Blaž Hrastnik 5803de2067 dap: Simplify more calls 2021-11-07 18:51:29 +09:00
Blaž Hrastnik 9baddc825d dap: Get rid of excessive cloning 2021-11-07 18:38:04 +09:00
Blaž Hrastnik fd9b826f2c dap: Inline empty completer 2021-11-07 18:15:17 +09:00
Blaž Hrastnik 5938ab1bf1 dap: Fully extract template parameter prompts 2021-11-07 18:13:37 +09:00
Blaž Hrastnik 3b8d5102ac Make picker take the whole context, not just editor 2021-11-07 18:03:04 +09:00
Blaž Hrastnik 64bb1f7563 dap: Extract out variable rendering
Will improve on the UI later
2021-11-07 17:55:01 +09:00
Omnikar ed23057ff8
Launch with defaults upon invalid config/theme (#982)
* Launch with defaults upon invalid config/theme

* Startup message if there is a problematic config
* Statusline error if trying to switch to an invalid theme

* Use serde `deny_unknown_fields` for config
2021-11-07 00:57:14 +09:00
Blaž Hrastnik e2a23ac0b5 If there is no live debugger, treat breakpoints as unverified 2021-11-07 00:48:34 +09:00
Blaž Hrastnik 2e1aa5f15b Fix compilation 2021-11-07 00:32:28 +09:00
Blaž Hrastnik 09d8c139af dap: Enable sticky mode for the submode 2021-11-07 00:29:12 +09:00
Blaž Hrastnik 14a3502cf1 dap: Move template selection into a picker
It's time to move all these components out of ui/editor.rs
2021-11-07 00:28:57 +09:00
Blaž Hrastnik f2b709a3c3 Merge branch 'master' into debug 2021-11-07 00:28:19 +09:00
Blaž Hrastnik 2c1313c064 Specify vector capacity on surround_add 2021-11-06 23:52:49 +09:00
Blaž Hrastnik 1a1685acf7 Simplify current!(..).1 into doc!() 2021-11-06 23:52:26 +09:00
Blaž Hrastnik 0f4cd73000 Simplify goto_*_diagnostic commands 2021-11-06 18:58:58 +09:00
Blaž Hrastnik f659e1178a minor: view!(..).doc is slightly more efficient than current!(..).1.id() 2021-11-06 17:54:04 +09:00
Blaž Hrastnik 4c1321b3b6 minor: Extend search was decclared twice in the keymap 2021-11-06 17:49:18 +09:00
Blaž Hrastnik b81a554424 Retain range direction on search
Co-authored-by: CossonLeo <20379044+cossonleo@users.noreply.github.com>
2021-11-06 17:41:30 +09:00
Blaž Hrastnik 6431b26a6a Implement Selection::replace to replace a single range
Fixes #985

Co-authored-by: Daniel S Poulin <crimsonmage+github@gmail.com>
2021-11-06 17:37:45 +09:00
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
2021-11-06 17:33:30 +09:00
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
2021-11-05 11:25:08 +09:00
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`
2021-11-05 10:20:06 +09:00
Blaž Hrastnik 7b65a6d687 Rewrite goto_buffer 2021-11-04 14:03:03 +09:00
ath3 78c68fae91 Implement "Goto next buffer / Goto previous buffer" commands 2021-11-04 14:03:03 +09:00
Blaž Hrastnik e2560f427e Replace documents SlotMap with BTreeMap 2021-11-04 13:43:45 +09:00
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>
2021-11-04 12:26:01 +09:00
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>
2021-11-04 12:24:52 +09:00
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>
2021-11-04 12:24:05 +09:00
Omnikar e39cfa40df
Hide keys bound to `no_op` from infobox (#971) 2021-11-04 09:50:38 +09:00
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
2021-11-03 12:02:29 +09:00
Triton171 7a0c4322ea Simplify BTreeSet construction
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-11-03 11:56:55 +09:00
Daniel Ebert eb8745db09 Implement key ordering for info box 2021-11-03 11:56:55 +09:00
CossonLeo 1720b98760
only remove primary index when search next without extend (#948) 2021-11-02 13:32:57 +09:00
dependabot[bot] 44ff597841
build(deps): bump tokio-stream from 0.1.7 to 0.1.8 (#953)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.7 to 0.1.8.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.7...tokio-stream-0.1.8)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-02 09:34:39 +09:00
Gygaxis Vainhardt f140a2a00e
Add arrow-key bindings for window switching (#933) 2021-10-30 10:48:00 +09:00
Blaž Hrastnik e5de103728 Extract a clear_completion method 2021-10-29 16:48:41 +09:00
Ivan Tham 49f6c2623f
Bump lsp-types to 0.91.0 (#932) 2021-10-29 12:00:18 +09:00
Ivan Tham bc6a34d97e
Make match work with extend and multi cursors (#920) 2021-10-29 10:08:53 +09:00
Ivan Tham 21d535565b
Support extend for multiple goto (#909)
gg, ge, [n]gg
2021-10-29 10:07:07 +09:00
cossonleo f1d339919f add expand_selection to last_motion 2021-10-29 10:04:12 +09:00
Blaž Hrastnik f3c7f20dbc Release v0.5.0 2021-10-28 16:41:34 +09:00
Omnikar db56de589a
Add `--tutor` option to `hx --help` output (#924)
* Add `--tutor` option to `hx --help` output

* Adjust `--tutor` location in help output
2021-10-28 16:27:28 +09:00
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>
2021-10-28 10:23:46 +09:00
Nehliin 3b0c5e993a Use deserialization fix instead 2021-10-28 10:22:52 +09:00
Oskar Nehlin 6e455fd3fb Apply suggestions from code review
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-10-28 10:22:52 +09:00
Nehliin da4d9340ba Make key macro more portable 2021-10-28 10:22:52 +09:00
Nehliin a4c5f46739 Fix order being empty and add test 2021-10-28 10:22:52 +09:00
Nehliin f133d80e70 Move test to test module 2021-10-28 10:22:52 +09:00
Nehliin fbba47fbc0 Fix panic when using multi-level key mapping 2021-10-28 10:22:52 +09:00
Blaž Hrastnik 5501669f8c Revert "minor: Rearrange helix-term Cargo.toml"
This reverts commit 2cee0c58ba.
2021-10-28 00:21:30 +09:00
Blaž Hrastnik 1066b081dd fix: When cycling through prompt history, update event needs to trigger 2021-10-27 18:23:17 +09:00
Blaž Hrastnik 2cee0c58ba minor: Rearrange helix-term Cargo.toml 2021-10-27 12:25:00 +09:00
Blaž Hrastnik 3fe353c47c Remove some old TODOs 2021-10-27 12:25:00 +09:00
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>
2021-10-27 12:24:24 +09:00
radical3dd d61e5e686b
Use current dir for file picker, after change dir. (#910) 2021-10-26 09:43:14 +09:00
CossonLeo f331ba9df4
Clear competion items when start_offset > cursor (#906) 2021-10-26 09:42:37 +09:00
CossonLeo b142fd4080
move_up will select last item, when no item selected (#907) 2021-10-26 09:42:23 +09:00
CossonLeo bca98b5bed
Add c-j c-k to menu keymap for move_up move_down (#908) 2021-10-26 09:42:08 +09:00
Blaž Hrastnik acc5ac5e73 fix warning 2021-10-25 11:11:11 +09:00
Blaž Hrastnik 3edca7854e completion: fully revert state before apply & insertText common prefix 2021-10-25 11:09:09 +09:00
Omnikar a7d87c79ce
Fix `:quit!` description and tense of other commands (#902) 2021-10-25 09:25:47 +09:00
Dmitry Sharshakov 6aa9838ea6
dap: support arrays as arguments 2021-10-24 17:24:18 +03:00
CossonLeo 2ed01f2d9c
find motion and textobj motion repeat (#891) 2021-10-24 22:47:10 +09:00
Blaž Hrastnik cee7ad781e Mark a few functions as `const` 2021-10-24 17:28:29 +09:00
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
2021-10-24 16:55:29 +09:00
Kirawi 0cb5e0b2ca
log syntax highlighting init errors (#895) 2021-10-23 21:52:18 +09:00
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
2021-10-23 20:06:40 +09:00
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
2021-10-23 11:41:19 +09:00
Blaž Hrastnik 96945be1a8 Fix doctest broken on 2021 edition 2021-10-22 12:47:02 +09:00
Blaž Hrastnik 182a59b552 Update to rust 1.56 + 2021 edition 2021-10-22 12:15:18 +09:00
Daniel S Poulin 3b032e8e1f
First stab at ignoring compressed files from picker (#767) 2021-10-22 10:02:05 +09:00
radical3dd b1ebd7a07e
Replace current selection with all yanked values. (#882) 2021-10-21 09:44:53 +09:00
Blaž Hrastnik e9b23c29d8 Ignore errors when disabling mouse capture 2021-10-20 00:01:11 +09:00
Blaž Hrastnik 9688cb74a1 Update dependencies to bump crossterm to 0.22.1
Fixes #825
Fixes #690
2021-10-19 23:58:51 +09:00
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
2021-10-19 18:37:38 +09:00
CossonLeo 9ac0c95161
Improve completion trigger (#838)
* improve idle completion trigger

* add completion-trigger-len to book

* rename semantics_completion to language_server_completion and optimize idle completion trigger
2021-10-18 15:14:50 +09:00
Blaž Hrastnik bda05ec4bf Use a newtype for ThreadId 2021-10-17 14:06:52 +09:00
Blaž Hrastnik 0a6b60085a Merge branch 'master' into debug 2021-10-17 13:51:56 +09:00
Ivan Tham 89707a858f
Make auto-completion a config (#853) 2021-10-16 22:57:41 +09:00
Blaž Hrastnik 2c0468ffd1 fix: If backspacing past the start offset, cancel completion
Refs #822
2021-10-16 18:43:07 +09:00
Omnikar c71b49497d
Set CWD when editor is started with a directory (#849) 2021-10-16 10:04:26 +09:00
Leoi Hung Kin 4d07eaa48b
Prevent LSP Messages from displaying when a prompt is presented (#824)
* Prevent LSP Messages from displaying when a prompt is presented

* use match guard
2021-10-15 17:36:39 +09:00
Blaž Hrastnik f8f63c5508
Merge pull request #821 from helix-editor/idle-timer
Idle timer / Autocompletion
2021-10-10 22:11:01 +09:00
Blaž Hrastnik 76b1bbc23a Allow trigger_offset to be unused for now 2021-10-10 12:33:22 +09:00
Blaž Hrastnik 633b981db2 Make idle-timeout configurable 2021-10-10 12:32:06 +09:00
Blaž Hrastnik c7f3a971c0 Remove resolved TODOs 2021-10-10 12:22:11 +09:00
Dmitry Sharshakov bc0084d071
fix command descriptions 2021-10-09 16:06:32 +03:00