aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/typed.rs
Commit message (Collapse)AuthorAge
* Fix command-mode completion behavior when input is escapedMichael Davis2022-11-07
| | | | | | | If `a\ b.txt` were a local file, `:o a\ <tab>` would fill the prompt with `:o aa\ b.txt` because the replacement range was calculated using the shellwords-parsed part. Escaping the part before calculating its length fixes this edge-case.
* Escape filenames in command completionMichael Davis2022-11-07
| | | | | | This changes the completion items to be rendered with shellword escaping, so a file `a b.txt` is rendered as `a\ b.txt` which matches how it should be inputted.
* Fix whitespace handling in command-mode completionMichael Davis2022-11-07
| | | | | | | | | | 8584b38cfbe6ffe3e5d539ad953c413e44e90bfa switched to shellwords for completion in command-mode. This changes the conditions for choosing whether to complete the command or use the command's completer. This change processes the input as shellwords up-front and uses shellword logic about whitespace to determine whether the command or argument should be completed.
* Correctly handle escaping in completion (#4316)Armin Ronacher2022-11-01
| | | | | * Correctly handle escaping in completion * Added escaping tests
* commands: Make no arg ':theme' show name (#3740)James O. D. Hunt2022-10-26
| | | | | | | | | | | | | | | | Most commands that accept an argument show their current value if no argument is specified. The `:theme` command previously displayed an error message in the status bar if not provided with an argument: ``` Theme name not provided ``` It now shows the current theme name in the status bar if no argument is specified. Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com> Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com>
* Add `:update` that will write the changes if the file has been modified. ↵Gaurav Tyagi2022-10-26
| | | | | | | | | (#4426) * add command update that will write the changes if file hasn been modified * add docs * update the docs
* fix: write-all crash (#4384)Skyler Hawthorne2022-10-21
| | | | | | | | | | | | | | | | When we do auto formatting, the code that takes the LSP's response and applies the changes to the document are just getting the currently focused view and giving that to the function, basically always assuming that the document that we're applying the change to is in focus, and not in a background view. This is usually fine for a single view, even if it's a buffer in the background, because it's still the same view and the selection will get updated accordingly for when you switch back to it. But it's obviously a problem for when there are multiple views, because if you don't have the target document in focus, it will ask the document to update the wrong view, hence the crash. The problem with this is picking which view to apply any selection change to. In the absence of any more data points on the views themselves, we simply pick the first view associated with the document we are saving.
* flush writes on force quit (#4397)Skyler Hawthorne2022-10-21
| | | | | | When force quitting, we need to block on the pending writes to ensure that write commands succeed before exiting, and also to avoid a crash when all the views are gone before the auto format call returns from the LS.
* Autosave all when the terminal loses focus (#3178)Charlie Groves2022-10-21
| | | | | | | | | | | * Autosave all when the terminal loses focus * Correct comment on focus config Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * Need a block_try_flush_writes in all quit_all paths Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Merge pull request #2267 from dead10ck/fix-write-failBlaž Hrastnik2022-10-20
|\ | | | | Write path fixes
| * fix tree_sitter_scopesSkyler Hawthorne2022-10-19
| |
| * Editor::flush_writes returns an errorSkyler Hawthorne2022-10-19
| |
| * Deduplicate flush_writesBlaž Hrastnik2022-10-19
| |
| * Use a single save_queue on the editorBlaž Hrastnik2022-10-19
| |
| * review commentsSkyler Hawthorne2022-10-19
| |
| * fix write scratch buffer to fileSkyler Hawthorne2022-10-19
| |
| * various fixes in write-all pathSkyler Hawthorne2022-10-19
| |
| * fix panic when view of pending write is closedSkyler Hawthorne2022-10-19
| |
| * fix write-quit with auto formatSkyler Hawthorne2022-10-19
| | | | | | | | | | write-quit will now save all files successfully even when there is auto formatting
| * fix modified status with auto formatSkyler Hawthorne2022-10-19
| |
| * improve reliability of shutdownSkyler Hawthorne2022-10-19
| |
| * add conditional noop render backSkyler Hawthorne2022-10-19
| | | | | | | | It makes it much slower without stubbing this out
| * update write-quit to wait for savesSkyler Hawthorne2022-10-19
| |
| * fix buffer-closeSkyler Hawthorne2022-10-19
| |
| * fix(write): do not set new path on document until write succeedsSkyler Hawthorne2022-10-19
| | | | | | | | | | | | If a document is written with a new path, currently, in the event that the write fails, the document still gets its path changed. This fixes it so that the path is not updated unless the write succeeds.
| * fix: buffer-close ensuring writesSkyler Hawthorne2022-10-19
| | | | | | | | Make sure buffer-close waits for the document to finish its writes.
| * chore(write): serialize write operations within a DocumentSkyler Hawthorne2022-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way that document writes are handled are by submitting them to the async job pool, which are all executed opportunistically out of order. It was discovered that this can lead to write inconsistencies when there are multiple writes to the same file in quick succession. This seeks to fix this problem by removing document writes from the general pool of jobs and into its own specialized event. Now when a user submits a write with one of the write commands, a request is simply queued up in a new mpsc channel that each Document makes to handle its own writes. This way, if multiple writes are submitted on the same document, they are executed in order, while still allowing concurrent writes for different documents.
* | Pretty print `tree-sitter-subtree` expression (#4295)Fisher Darling2022-10-19
|/
* display tree sitter scopes in a popup (#4337)Roberto Vidal2022-10-18
|
* fix `:insert-output` doc: inserting output **before** each selection (#4286)ZJPzjp2022-10-15
|
* Apply transactions to the jumplist for undo/redo (#4227)Michael Davis2022-10-12
| | | | | Undo/redo/earlier/later call `Document::apply_impl` which applies transactions to the document. These transactions also need to be applied to the view as in 0aedef0.
* Add a helper function for applying transactionsMichael Davis2022-10-11
| | | | | | It is easy to forget to call `Document::apply` and/or `View::apply` in the correct order. This commit introduces a helper function which closes over both calls.
* Apply transactions to ViewsMichael Davis2022-10-11
| | | | | | This change adds View::apply calls for all Document::apply call-sites, ensuring that changes to a document do not leave invalid entries in the View's jumplist.
* Change focus to modified docs on quit (#3872)A-Walrus2022-10-03
| | | | | | | | | | | | | | | | | | * Change focus to modified docs on quit When quitting with modified documents, automatically switch focus to one of them. * Update helix-term/src/commands/typed.rs Co-authored-by: Poliorcetics <poliorcetics@users.noreply.github.com> * Make it work with buffer-close-all and the like * Cleanup Use Cow instead of String, and rename DoesntExist -> DoesNotExist Co-authored-by: Poliorcetics <poliorcetics@users.noreply.github.com>
* Find workspace from document path (#3553)ath32022-10-03
|
* Add goto preview (#2982)Joe2022-10-03
|
* add :lsp-restart command (#3435)Filipe Azevedo2022-09-20
|
* Fix preview bug (#3644)Joe2022-09-20
| | | | | * Fix preview bug * Add comment to empty case
* Remove the .txt suffix from tutorBlaž Hrastnik2022-09-11
| | | | | | | | | | | | The tutor file is loaded as .txt which can potentially spawn a language server. Then the path is unset, but the LS remains active. This can cause panics since updates are now submitted for a doc with no path. As a quick workaround we remove the extension which should avoid detection. Fixes #3730
* Switch to Result for invalid languageA-Walrus2022-09-10
|
* Add error handling to set language commandA-Walrus2022-09-10
| | | | | If you type a nonexistant language an appropriate message will show, and the language won't be changed.
* Fix :reflow panic by enusring cursor in view (#3733)A-Walrus2022-09-07
|
* Detect indent-style in `:set-language` (#3330)Michael Davis2022-08-05
| | | | | | | Indent style may change when choosing a language with `:set-language`. Line-endings most likely will not change, but `:set-language` should have a similar effect as reloading a file (`:reload`), plus the two are currently grouped in the implementation and line-ending detection is not particularly expensive.
* Avoid copying fragments (#3136)Matthias Deiml2022-08-04
| | | | | | | * Avoid copying fragments * Add slice / slices method * Better documentation for fragment and slice methods
* Shorten embedded command descriptions (#3070)Gokul Soumya2022-07-26
| | | | | | | | | * Shorten embedded command descriptions - Compact descriptions in command palette and infobox * Shorten typed command descriptions * Fix typo in decrement command description
* add statusline element to display file line endings (#3113)Alexis Kalabura2022-07-21
| | | | | | | | | * add statusline element to display file line endings * run cargo fmt --all * change the word *ending* from plural to singular * support for the unicode-lines feature flag
* Add lsp signature help (#1755)Gokul Soumya2022-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add lsp signature help * Do not move signature help popup on multiple triggers * Highlight current parameter in signature help * Auto close signature help * Position signature help above to not block completion * Update signature help on backspace/insert mode delete * Add lsp.auto-signature-help config option * Add serde default annotation for LspConfig * Show LSP inactive message only if signature help is invoked manually * Do not assume valid signature help response from LSP Malformed LSP responses are common, and these should not crash the editor. * Check signature help capability before sending request * Reuse Open enum for PositionBias in popup * Close signature popup and exit insert mode on escape * Add config to control signature help docs display * Use new Margin api in signature help * Invoke signature help on changing to insert mode
* 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
* Remove a couple more unwrapsBlaž Hrastnik2022-06-21
|
* Merge pull request #2359 from dead10ck/test-harnessBlaž Hrastnik2022-06-21
|\ | | | | Integration testing harness