We correctly filter out the language server inside Document to ignore it
if the capabilities are missing, so this way it'll simply ignore the
errored out LSP rather than panicking.
1. pressing o on a line with no indentation will open a new line as
expected, but esc will then delete the line altogether
2. the kill_line behavior happens after insert mode changes are already
commited to history, and the change isn't commited. pressing u after
this will break highlighting & undo history
This reverts commit c08d2fae58.
Tree sitter returns an index referring to the position of the scope in
the scopes array. We can use that same index to avoid a hashmap lookup
and instead store the styles in an array.
This currently stores the styles in both a map and an array because the
UI still uses hashmap lookups, but it's a reasonable tradeoff.
* restore indent when press esc right after open a new line
* add comment for restore_indent
* fix, and make kill to line end behaves like emacs
* update comment
* fix comment
* adjust cancel restore_indent situation
* check esc logic in mode transaction
* improve comment
* add more check for dedent
* update comment
* use matches to check for last_cmd
* no need to introduct CommandFun type
* accept count for goto_window
also fix view is not fullfilled issue
* fix fulfilled mispell
* Update helix-term/src/commands.rs
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* Update helix-term/src/commands.rs
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* fix merge issue
* revert line computation logic
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* goto_file
* support goto_file under current cursor
* add C-w f/F
* sync space w with window mode
* Update helix-term/src/commands.rs
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Fixes#1077. This was caused by the assumption that a block
cursor is represented as zero width internally and simply
rendered to be a single width selection, where as in reality
a block cursor is an actual single width selection in form and
function.
Behavioural changes:
1. Surround selection no longer works when cursor is _on_ a
surround character that has matching pairs (like `'`
or `"`). This was the intended behaviour from the start
but worked till now because of the cursor position
calculation mismatch.
fixes#1136
* removed a log::info
* removed temp.rs
* cargo clippy no longer complains
* new get_lang_server function
* get_lang_server is now launch_language_server
* launch_lang_server will now close the previous one
* better code readability
* remove resfresh_ls(and a wrong comment)
* Do not crash when run goto command without line number
Report an error when running goto command without entering a
line number.
Fixes#1159
* Use is_empty() instead check len zero
* Add typable `goto` command
* Support `:<line-number>` on prompt
* Rename function according to convention
* Directly call into goto_line_number function
* align lines
* remove log statement
* use selections to align
* fix a clippy issue
* only accept 1,2,3 as user count
* Update helix-term/src/commands.rs
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* return if user count is not correct
* add doc
Co-authored-by: Ivan Tham <pickfire@riseup.net>