aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/mod.rs
Commit message (Collapse)AuthorAge
* 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>
* completion: remove_follow links on filename_implBlaž Hrastnik2022-08-30
| | | | | We don't need to follow links since we're only scanning the current directory level (non-recursive).
* remove duplicate entries from theme picker (#3439)ChrHorn2022-08-15
|
* Add completion for nested settings (#3183)A-Walrus2022-08-06
| | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* 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
* support prefilling prompt (#2459)Bob2022-07-18
| | | | | | | | | * support prefilling prompt * introduce with_line builder method in Prompt * extract show_prompt * use textobject_word as fallback input
* Customizable/configurable status line (#2434)Mr. E2022-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(statusline): add the file type (language id) to the status line * refactor(statusline): move the statusline implementation into an own struct * refactor(statusline): split the statusline implementation into different functions * refactor(statusline): Append elements using a consistent API This is a preparation for the configurability which is about to be implemented. * refactor(statusline): implement render_diagnostics() This avoid cluttering the render() function and will simplify configurability. * feat(statusline): make the status line configurable * refactor(statusline): make clippy happy * refactor(statusline): avoid intermediate StatusLineObject Use a more functional approach to obtain render functions and write to the buffers, and avoid an intermediate StatusLineElement object. * fix(statusline): avoid rendering the left elements twice * refactor(statusline): make clippy happy again * refactor(statusline): rename `buffer` into `parts` * refactor(statusline): ensure the match is exhaustive * fix(statusline): avoid an overflow when calculating the maximal center width * chore(statusline): Describe the statusline configurability in the book * chore(statusline): Correct and add documentation * refactor(statusline): refactor some code following the code review Avoid very small helper functions for the diagnositcs and inline them instead. Rename the config field `status_line` to `statusline` to remain consistent with `bufferline`. * chore(statusline): adjust documentation following the config field refactoring * revert(statusline): revert regression introduced by c0a1870 * chore(statusline): slight adjustment in the configuration documentation * feat(statusline): integrate changes from #2676 after rebasing * refactor(statusline): remove the StatusLine struct Because none of the functions need `Self` and all of them are in an own file, there is no explicit need for the struct. * fix(statusline): restore the configurability of color modes The configuration was ignored after reintegrating the changes of #2676 in 8d28f95. * fix(statusline): remove the spinner padding * refactor(statusline): remove unnecessary format!()
* 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
* Reuse menu::Item trait in picker (#2814)Gokul Soumya2022-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor menu::Item to accomodate external state Will be useful for storing editor state when reused by pickers. * Add some type aliases for readability * Reuse menu::Item trait in picker This opens the way for merging the menu and picker code in the future, since a picker is essentially a menu + prompt. More excitingly, this change will also allow aligning items in the picker, which would be useful (for example) in the command palette for aligning the descriptions to the left and the keybinds to the right in two separate columns. The item formatting of each picker has been kept as is, even though there is room for improvement now that we can format the data into columns, since that is better tackled in a separate PR. * Rename menu::Item::EditorData to Data * Call and inline filter_text() in sort_text() completion * Rename diagnostic picker's Item::Data
* Sort themes, language & files by score & then name (#2675)Michael Jones2022-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Sort themes by score & then name Previously the themes were appearing unordered after typing ':theme '. This sorts them first by fuzzy score and then by name so that they generally appear in a more ordered fashion in the initial list. The sort by name does not really pay off when there is a score so an alternative approach would be to sort by name if there is string to fuzzy match against and otherwise sort by score. I've lowercased the names as that avoids lower case & upper case letters being sorted into separate groups. There might be a preferable approach to that though. * Sort language & files by score then name And change to use sort_unstable_by instead of sort_unstable_by_key as it allows us to avoid some allocations. I don't fully understand the flow of the 'filename_impl' function but this seems to deliver the desired results. * Remove unnecessary reference Co-authored-by: Michael Davis <mcarsondavis@gmail.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Add workspace and document diagnostics picker (#2013)Falco Hirschenberger2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add workspace and document diagnostics picker fixes #1891 * Fix some of @archseer's annotations * Add From<&Spans> impl for String * More descriptive parameter names. * Adding From<Cow<str>> impls for Span and Spans * Add new keymap entries to docs * Avoid some clones * Fix api change * Update helix-term/src/application.rs Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com> * Fix a clippy hint * Sort diagnostics first by URL and then by severity. * Sort diagnostics first by URL and then by severity. * Ignore missing lsp severity entries * Add truncated filepath * Typo * Strip cwd from paths and use url-path without schema * Make tests a doctest * Better variable names Co-authored-by: Falco Hirschenberger <falco.hirschenberger@itwm.fraunhofer.de> Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com>
* Remove a couple more unwrapsBlaž Hrastnik2022-06-21
|
* Add more context; Editor::open doesn't need to own pathSkyler Hawthorne2022-06-19
|
* Better handling of symlinks (#2718)Roland Kovacs2022-06-15
| | | | | | | | | | - Add file-picker.follow-symlinks configuration option (default is true), this also controls if filename and directory completers follow symlinks. - Update FilePicker to set editor error if opening a file fails, instead of panicing. Fix #1548 Fix #2246
* prompt: If submitting empty prompt, use default (last used)Blaž Hrastnik2022-06-06
|
* Add runtime language configuration (#1794) (#1866)Roland Kovacs2022-04-05
| | | | | | | | | | | | | | | | | | | | | * Add runtime language configuration (#1794) * Add set-language typable command to change the language of current buffer. * Add completer for available language options. * Update set-language to refresh language server as well * Add language id based config lookup on `syntax::Loader`. * Add `Document::set_language3` to set programming language based on language id. * Update `Editor::refresh_language_server` to try language detection only if language is not already set. * Remove language detection from Editor::refresh_language_server * Move document language detection to where the scratch buffer is saved. * Rename Document::set_language3 to Document::set_language_by_language_id. * Remove unnecessary clone in completers::language
* Remove more push_layer callsBlaž Hrastnik2022-03-28
|
* Make regex_prompt directly call cx.push_layerBlaž Hrastnik2022-03-28
|
* Add refresh-config and open-config command (#1803)Joe2022-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add refresh-config and open-config command * clippy * Use dynamic dispatch for editor config * Refactor Result::Ok to Ok * Remove unused import * cargo fmt * Modify config error handling * cargo xtask docgen * impl display for ConfigLoadError * cargo fmt * Put keymaps behind dyn access, refactor config.load() * Update command names * Update helix-term/src/application.rs Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * Switch to unbounded_channel * Remove --edit-config command * Update configuration docs * Revert "Put keymaps behind dyn access", too hard This reverts commit 06bad8cf492b9331d0a2d1e9242f3ad4e2c1cf79. * Add refresh for keys * Refactor default_keymaps, fix config default, add test * swap -> store, remove unneeded clone * cargo fmt * Rename default_keymaps to default Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Use `^` and `$` to match the beginning and end of a line when searching (#1790)nibon72022-03-12
| | | | | Fixes #1737 Signed-off-by: nibon7 <nibon7@163.com>
* migrate grammar fetching/building code into helix-loader crateMichael Davis2022-03-10
| | | | | | | | | This is a rather large refactor that moves most of the code for loading, fetching, and building grammars into a new helix-loader module. This works well with the [[grammars]] syntax for languages.toml defined earlier: we only have to depend on the types for GrammarConfiguration in helix-loader and can leave all the [[language]] entries for helix-core.
* Picker performance improvementsBlaž Hrastnik2022-03-03
|
* Add jumplist support for the search (closes #1625) (#1718)Philipp Mildenberger2022-03-01
|
* Minor cleanup of file picker file gathering logic (#1683)Daniel S Poulin2022-03-01
| | | | | | | | | | | | | * Refactor file picker filetype filter logic to remove panic, make clearer An unwrap was unneccesarily present due to a prior contribution of mine which was before I had any understanding of error handling in Rust. I've also swapped a match for an if let, as was originally suggested in the original pull request adding filetype filtering, but was merged before I could address. * Add some comments to the file picker code for clarity * Switch to expect instead of ignoring type def error
* Always ignore the .git directory in file picker (#1604)Daniel S Poulin2022-02-20
| | | | | Some users (including myself) want to turn off filtering of files prefixed with `.`, as they are often useful to edit. For example, `.env` files, configuration for linters `.eslint.json` and the like.
* Extract a helper function for lsp::LocationBlaž Hrastnik2022-02-18
|
* Manually recalculate initial completion where it mattersBlaž Hrastnik2022-02-17
|
* Pass through Editor instead of ContextBlaž Hrastnik2022-02-17
|
* helix-term: implement buffer completerCole Helbling2022-02-17
| | | | | | In order to implement this completer, the completion function needs to be able to access the compositor's context (to allow it to get the list of buffers currently open in the context's editor).
* Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard ↵Ludwig Stecher2022-02-15
| | | | | | | | | | | | | | | shortcuts to file picker (#1612) * Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker * Refactor file picker paging logic * change key mapping * Add overlay component * Use closure instead of margin to calculate size * Don't wrap file picker in `Overlay` automatically
* use PathBuf::to_string_lossy() instead of to_str() (#1655)Kirawi2022-02-15
|
* Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2022-02-13
|\
| * feat(editor): add config for search wrap_around (#1516)Matouš Dzivjak2022-02-10
| | | | | | | | | | | | | | | | | | * feat(editor): add config for search wrap_around Fixes: https://github.com/helix-editor/helix/issues/1489 * Move search settings into separate config * Disable linter
| * Render code actions as a menu, allow adding padding to popupBlaž Hrastnik2022-01-31
| |
| * fix: Use std::path::MAIN_SEPARATOR to determine completionBlaž Hrastnik2022-01-06
| | | | | | | | Refs #1439
| * Revert "Convert Windows style path separator in completers to Unix style ↵Blaž Hrastnik2022-01-05
| | | | | | | | | | | | (#1389)" This reverts commit 49444f9c0569a070ffd3c82cee6146656a0ac63c.
| * Convert Windows style path separator in completers to Unix style (#1389)ath32021-12-29
| |
| * Update settings at runtime (#798)Tamo2021-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: Update settings at runtime fix the clippy warning * update the documentation * use to_value instead of to_vec+from_value * drop the equal * remove an useless comment * apply suggestion
| * Load alt default theme if true color is not supportedOmnikar2021-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move `runtime/themes/base16_default_terminal.toml` to `base16_theme.toml` alongside `theme.toml` * Use `terminfo` crate to detect whether the terminal supports true color and, if the user has no theme configured and their terminal does not support true color, load the alt default theme instead of the normal default. Remove `terminfo` dependency, use `COLORTERM` env instead Prevent user from switching to an unsupported theme Add `true-color-override` option If the terminal is wrongly detected to not support true color, `true-color-override = true` will override the detection. Rename `true-color-override` to `true-color`
* | Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2021-11-30
|\|
| * File picker config (#988)Dan Nases Sha2021-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * squashed WIP commits * hide_gitignore working with config * pass reference to new config parameter of file_picker() * update config option name to match name on walk builder * add comments to config and documentation of option to book * add git_ignore option to WalkBuilder within prompt in commands.rs * WIP: add FilePickerConfig struct * WIP: cleanup * WIP: add more options including max_depth * WIP: changed defaults to match ignore crate defaults * WIP: change WalkBuilder in global_search() to use config options * WIP: removed follow_links, changed max_depth to follow config setting * WIP: update book with file-picker inline table notation * update documentation for file-picker config in book * adjusted to [editor.file-picker] in book configuration.md * adjust comments in editor.rs to be doc comments, cleanup * adjust comments * adjust book
* | dap: Remove the prompt line parameter, use insert_str insteadBlaž Hrastnik2021-11-22
| |
* | Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2021-11-21
|\|
| * Restore screen position when abort search (#1047)Ivan Tham2021-11-10
| |
* | Make picker take the whole context, not just editorBlaž Hrastnik2021-11-07
| |
* | Merge branch 'master' into debugBlaž Hrastnik2021-11-06
|\|
| * Add c-s to pick word under doc cursor to prompt line & search completion (#831)CossonLeo2021-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * First stab at ignoring compressed files from picker (#767)Daniel S Poulin2021-10-22
| |
* | Merge branch 'master' into debugDmitry Sharshakov2021-09-25
|\|
| * Initial implementation of global search (#651)Leoi Hung Kin2021-09-21
| | | | | | | | | | | | | | | | | | | | | | * initial implementation of global search * use tokio::sync::mpsc::unbounded_channel instead of Arc, Mutex, Waker poll_fn * use tokio_stream::wrappers::UnboundedReceiverStream to collect all search matches * regex_prompt: unified callback; refactor * global search doc