aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
Commit message (Collapse)AuthorAge
* 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
* 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
* Suport diagnostic code (#3096)Erasin2022-07-26
| | | | | | | * add code for diagnostic. This PR provides a solution to resolve #2994. missing Code Actions for lsp * remote unused import
* add spacer element to statusline (#3165)Seth Bromberger2022-07-26
| | | | | * add spacer element to statusline * docs
* Auto pair-removal (#2940)Houkime2022-07-22
| | | | | | | | | | | | | | | * auto pair-removal Fixes https://github.com/helix-editor/helix/issues/1673 * autopairs removal: use doc autopairs * autopairs-removal: limit to one-char selections * use single_grapheme() to check if range is one char * fix errouneous deletes of " and other symmetric autopairs when at buffer start Co-authored-by: Houkime <>
* keep jump/file history when using :split (#3031)Robin2022-07-22
| | | | | | | * keep jump/file history when using :split * move history cloning into the switch function Co-authored-by: Robin <robinvandijk@klippa.com>
* jumplist picker (#3033)Bob2022-07-22
| | | | | | | | | | | | | * jumplist picker * remove jumps slicing Co-authored-by: Benoît Cortier <bcortier@proton.me> * remove unnecessary deref format! parameter Co-authored-by: Benoît Cortier <bcortier@proton.me> Co-authored-by: Benoît Cortier <bcortier@proton.me>
* 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
* Set the selection point of the first file correctly (#3073)Narazaki Shuji2022-07-18
|
* 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.
* respect count for selecting next/previous match (#3056)Bob2022-07-13
|
* respect count for repeating motion (#3057)Bob2022-07-13
|
* fix: error that caused usize to overflow (#3024)Slug2022-07-10
| | | | | * fix: error that caused usize to overflow * update: changed check_sub to saturating_sub
* Show file path only in workspace diagnostic pickerGokul Soumya2022-07-06
|
* Display error code only if not noneGokul Soumya2022-07-06
|
* Sub sort diagnostics by line numberGokul Soumya2022-07-06
|
* Display diagnostic text before code in pickerGokul Soumya2022-07-06
|
* Remove source from diagnostic picker displayGokul Soumya2022-07-06
| | | | | It is usually the name of the LSP and doesn't add much useful information.
* 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
* Fix backwards selection duplication widening bug (#2945)A-Walrus2022-07-04
| | | | | | | | | | | | | * Fix backwards selection duplication widening bug * Add integration tests * Make tests line-ending agnostic Make tests line-ending agnostic Use indoc to fix tests Fix line-ending on test input
* 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>
* adds --vsplit and --hsplit arguments (#2773)plexom2022-07-01
| | | | | | | | | * adds --vsplit and --hsplit arguments * moved comment * fixed lint (third time's a charm) * changed vsplit and hsplit from two separate bools to type Option<Layout>, and some cleanup
* Add new key bindings to view mode (#2803)Benjamin Rich2022-07-01
| | | | | | | * Make view mode more pager-like Addresses #2721 * Remove view mode bindings for J and K
* Fix backwards character deletion on other whitespaces (#2855)Sora2022-07-01
| | | | | | | | | | | * delete_backwards_char accepts any type of whitespace * Fix inconsistency, where unicode whitespaces are treated as normal whitespaces * Changed back to direct whitespace match * Only accept explicit whitespace / tabs Co-authored-by: s0LA1337 <dreamer@neoncity.dev>
* 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
* Fix recursive macro crash and empty macro lockout (#2902)PabloMansanet2022-06-28
|
* 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.
* feat: highlight / select symbol under cursor using LSP ↵lazytanuki2022-06-27
| | | | | | | | | textDocument/documentHighlight (#2738) * feat: highlight symbol under cursor using LSP textDocument/documentHighlight * fix: please clippy * fix: shorter description and code style
* 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
* Redetect indent and line endings after language server replaces documents ↵farwyler2022-06-24
| | | | | | | | | | | (#2778) * redetect indent and line endings after language server replaces document * removes nested if * always redetect indent and line endings after format This reverts commit 764d14f55894dc7213e48022dfa0f91829b8ef59.
* 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