aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
Commit message (Collapse)AuthorAge
* Correctly handle escaping in completion (#4316)Armin Ronacher2022-11-01
| | | | | * Correctly handle escaping in completion * Added escaping tests
* fix: Never create automatic doc popups outside of Insert mode (#4456)Poliorcetics2022-10-28
|
* 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
* nit: Do less allocations in `ui::menu::Item::label` implementationsAlexis (Poliorcetics) Bourget2022-10-21
| | | | | | This complicates the code a little but it often divides by two the number of allocations done by the functions. LSP labels especially can easily be called dozens of time in a single menu popup, when listing references for example.
* 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>
* Sort by fixed diagnostics/is_preffered within codeaction categoriesPascal Kuthe2022-10-21
|
* never sort menu items when no fuzzy matching is possiblePascal Kuthe2022-10-21
|
* use permalink to vscode repoPascal Kuthe2022-10-21
|
* use stable sort instead of allocating new vectorsPascal Kuthe2022-10-21
|
* sort codeaction by their kind instead of alphabeticallyPascal Kuthe2022-10-21
|
* 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
| |
| * remove Callback::Compositor variantSkyler Hawthorne2022-10-19
| | | | | | | | To reduce likelihood of accidental discarding of important callbacks
| * 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 border from code actions popup (#3444)A-Walrus2022-09-13
|
* 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
|
* fix: Recalculate completion when going through prompt history (#3193)Frojdholm2022-08-31
| | | | | | | | | | | | | | | | | | | | | | | | * fix: Recalculate completion when going through prompt history * Update completion when the prompt line is changed It should not be possible to update the line without also updating the completion since the completion holds an index into the line. * Fix Prompt::with_line recalculate completion with_line was the last function where recalculate completion had to be done manually. This function now also recalculates the completion so that it's impossible to forget. * Exit selection when recalculating completion Keeping the selection index when the completion has been recalculated doesn't make sense. This clears the selection automatically, removing most needs to manually clear it. * Remove &mut on save_filter Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Derive Document language name from languages.toml name key (#3338)Michael Davis2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Derive Document language name from `languages.toml` `name` key This changes switches from deriving the language name from the `languages.toml` `scope` key to `name` (`language_id` in the `LanguageConfiguration` type). For the most part it works to derive the language name from scope by chopping off `source.` or `rsplit_once` on `.` but for some languages we have now like html (`text.html.basic`), it doesn't. This also should be a more accurate fallback for the `language_id` method which is used in LSP and currently uses the `rsplit_once` strategy. Here we expose the language's name as `language_name` on `Document` and replace ad-hoc calculations of the language name with the new method. This is most impactful for the `file-type` statusline element which is using `language_id`. * Use `Document::language_name` for the `file-type` statusline element The `file-type` indicator element in the statusline was using `Document::language_id` which is meant to be used to for telling Language Servers what language we're using. That works for languages with `language-server` configurations in `languages.toml` but shows text otherwise. The new `Document::language_name` method from the parent commit is a more accurate way to determine the language.