aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
Commit message (Collapse)AuthorAge
* Fix tab highlight when tab is partially visible (#3313)A-Walrus2022-08-06
| | | | | | | | | | * Fix tab highlight when tab is partially visible * Make it style based, and not truncation based Dealing with truncating is a mess, especially when it comes to wide unicode graphemes. This way it should work no matter what. * Inline style calculation into branches
* Fix indent guide styling (#3324)A-Walrus2022-08-06
| | | | | | | | | | | | | | * Fix incorrect indent guide styling Before the indent guides on top of whitespace inherited the theme from them. Now they do not. * Fix dark_plus theme indent_guides * Use whitespace style as fallback for indent-guide * Fix dark_plus theme indent_guides * Move indent_guide style patching out of loop
* Avoid copying fragments (#3136)Matthias Deiml2022-08-04
| | | | | | | * Avoid copying fragments * Add slice / slices method * Better documentation for fragment and slice methods
* Resolve clippy lints (#3307)Omnikar2022-08-04
|
* Don't add empty prompt input to history (#3259)A-Walrus2022-07-30
|
* add configurable / theme-able statusline separator string (#3175)Seth Bromberger2022-07-26
| | | | | | | | | | | * add configurable separator element to statusline * themable separator * clippy fixes * changed default separator to │ * doc updates
* add position-percentage as a statusline indicator (#3168)Seth Bromberger2022-07-26
| | | | | | | | | * added position-pct as a statusline indicator * removed unnecessary mutable reference * pct -> percent * percent -> percentage
* add spacer element to statusline (#3165)Seth Bromberger2022-07-26
| | | | | * add spacer element to statusline * docs
* 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
* fix: Indent levels could bleed over on the left edgeBlaž Hrastnik2022-07-20
| | | | | | Fixes #3087 Refs #3105 # modified: theme.toml
* 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
* Make gutters padding optional (#2996)Ivan Tham2022-07-18
| | | | If all gutters are removed, there are still an extra one padding, would be nice to remove that to save some space.
* support toggling pickers' preview panel (#3021)Bob2022-07-18
| | | | | * support toggling pickers' preview panel * add doc for toggling preview
* 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!()
* feat(term): uniformize word-wise movement and deletion (#2500)Benoît Cortier2022-07-15
| | | | | | | | | | | | Ctrl-based shortcuts are common in numerous applications. This change: - Adds Ctrl+{Left/Right/Backspace/Delete} for word-wise movement/deletion in prompt, picker, … - Removes Alt-Left and Alt-Right in prompt, picker, … - Adds Alt-Delete in insert mode for forward word deletion In some terminals, Alt-Backspace might not work because it is ambigous. See: https://github.com/helix-editor/helix/pull/2193#issuecomment-1105042501 Hence, Alt alternative is not removed.
* Fix some typos (#2978)A-Walrus2022-07-06
|
* 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
* Highlight whole row in picker menus (#2939)ChrHorn2022-07-02
|
* 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 mode specific styles (#2676)Mathspy2022-06-30
| | | | | | | | | | | | | * Add mode specific styles In similar vein to neovim's lualine and similar statusline packages this allows helix users to style their mode based on which mode it is thus making each mode more visually distinct at a glance * Add an example based on rosepine * Add editor.colors-mode config * Document statusline mode styles
* 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>
* fixes background reset (#2900)Seth Bromberger2022-06-28
| | | | | | | | | * fixes background reset * moves creation of default style out of loop * patches with background_style * removes commented code
* Refactor handling of mouse events (#2893)Gokul Soumya2022-06-27
| | | | | | - Simplified match statements by destructuring MouseEvent struct at the top and then matching on event.kind. - Extracted out closures for calculating (1) position and view of mouse click and (2) gutter coordinates and view of mouse click.
* Only draw cursorline in the currently focused bufferBlaž Hrastnik2022-06-27
|
* Implement cursorline (#2170)Tobias Menzi2022-06-27
| | | | | * Implement cursorline * Binary search possible lines
* Right align scrollbar with track in completion popup (#2754)Gokul Soumya2022-06-27
| | | | | - Align the scollbar to the right edge of the popup rather than at a margin of one. - Add a scrollbar track and a new scope `ui.menu.scroll`.
* Add single width left margin for completion popup (#2728)Gokul Soumya2022-06-26
| | | | | | | | | | | | | | * Add single width left margin for completion popup * Clear with ui.menu style before rendering menu When rendering a completion popup, the popup component will clear the area with ui.popup and then the menu component would draw over it using a table component. We remove the left edge of the area before passing it to the table component (so that it will be left as padding), and the table component uses ui.menu as the style. If ui.menu and ui.popup are different the left edge of the popup will look different from the rest of the popup. We avoid this by clearing the whole area with ui.menu in Menu::render
* fixes showing the last prompt on empty input (#2870)Saber Haj Rabiee2022-06-24
|
* check selection's visible width when copying on mouse click (#2711)Michael Davis2022-06-24
| | | | | | | | | | | | | | * check selection's visible width when copying on mouse click Mouse-click-up copies the selection produced by dragging. The event is ignored if the selection has a width of 1 though so you don't copy when clicking rather than dragging. The current check copies text when it has a visible width of 1 but is actually multiple characters in the rope like a CRLF line-ending. With this change we check the unicode width of the character(s) in the selection rather than the range length, so clicking on a CRLF line-ending does not copy. * use range.fragment to simplify getting the primary selection width
* fixes #2856 by resetting style on diagnostic (#2861)Seth Bromberger2022-06-22
|
* Fix scrollbar length proportional to total menu items (#2860)Gokul Soumya2022-06-22
| | | | | | The scrollbar length used to increase with more entries in the menu, which was counter-intuitive to how scrollbars worked in most applications. Turns out there was a typo in the floor division implementation :)
* Remove a couple more unwrapsBlaž Hrastnik2022-06-21
|
* Merge pull request #2359 from dead10ck/test-harnessBlaž Hrastnik2022-06-21
|\ | | | | Integration testing harness
| * Merge branch 'master' into test-harnessBlaž Hrastnik2022-06-21
| |\
| * | Add more context; Editor::open doesn't need to own pathSkyler Hawthorne2022-06-19
| | |
* | | Refactor Margin for fine grained control (#2727)Gokul Soumya2022-06-21
| | |
* | | Format keys identically in statusline and command palette (#2790)Gokul Soumya2022-06-21
| | | | | | | | | | | | | | | | | | The command palette previously used + as a delimiter for denoting a single key in a key sequence, (like C+w). This was at odds with how the statusline displayed them with pending keys (like <C-w>). This patch changes the palette formatting to the statusline formatting
* | | Make indent guides configurableGokul Soumya2022-06-21
| | |
* | | Add indent guides supportGokul Soumya2022-06-21
| |/ |/|
* | Default rulers color to red (#2669)Mathspy2022-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Default rulers color to red Currently if the theme a user is using doesn't have `ui.virtual.rulers` set and they set up a ruler it just fails silently making it really hard to figure out what went wrong. Did they set incorrectly set the ruler? Are they using an outdated version of Helix that doesn't support rulers? This happened to me today, I even switched to the default theme with the assumption that maybe my theme just doesn't have the rulers setup properly and it still didn't work. Not sure if this is a good idea or not, feel free to suggest better alternatives! * Use builtin Style methods instead of Bevy style defaults Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Only default the style if there's no ui or ui.virtual * Update themes style from ui.virtual to ui.virtual.whitespace * Revert ui.virtual change in onelight theme * Prefer unwrap_or_else Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* | mouse selection now uses character indexing (#2839)Mathis Brossier2022-06-20
|/
* Improve markdown list rendering (#2687)Frojdholm2022-06-15
| | | | | | | * Cleanup old commented code * Implement line breaks in markdown rendering * Implement markdown nested, numbered and multiparagraph lists
* 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
* Do not add extra line breaks in markdown lists (#2689)Frojdholm2022-06-08
|
* prompt: If submitting empty prompt, use default (last used)Blaž Hrastnik2022-06-06
|
* Update to ropey 1.5Blaž Hrastnik2022-05-30
|
* Bump dependencies, allow retain_mut for nowBlaž Hrastnik2022-05-29
|
* Add theme key for picker separator (#2523)kyrime2022-05-22
| | | Co-authored-by: ky <>