aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
Commit message (Collapse)AuthorAge
...
* sort autocompletins by fuzzy matchPascal Kuthe2022-10-21
|
* sort codeaction by their kind instead of alphabeticallyPascal Kuthe2022-10-21
|
* remove Callback::Compositor variantSkyler Hawthorne2022-10-19
| | | | To reduce likelihood of accidental discarding of important callbacks
* factor editor event handling into functionSkyler 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
* Replace `in_bounds` with calculation of end_indentA-Walrus2022-10-17
| | | | | | Instead of repeatedly checking if it is in_bounds, calculate the max_indent beforehand and just loop. I added a debug_assert to "prove" that it never tries drawing out of bounds.
* Only draw indent guides within boundsA-Walrus2022-10-17
| | | | | | Better performance, and otherwise very long lines with lots of tabs will wrap around the u16 and come back on the other side, messing up the beginning skip_levels.
* Make skip_levels a u8A-Walrus2022-10-17
|
* Fix rendering of lines longer than 2^16A-Walrus2022-10-17
| | | | | Before things would be cast to u16 earlier than needed, which would cause problems for insanely long lines (longer than 2^16 ~ 65 thousand)
* Fix debug assertion for diagnostic sort order (#4319)Michael Davis2022-10-16
| | | | | | | The debug assertion that document diagnostics are sorted incorrectly panics for cases like `[161..164, 162..162]`. The merging behavior in the following lines that relies on the assertion only needs the input ranges to be sorted by `range.start`, so this change simplifies the assertion to only catch violations of that assumption.
* nit: remove a String allocation that is immediately used as an &str (#4277)Poliorcetics2022-10-14
|
* Overlay all diagnostics with highest severity on top (#4113)Michael Davis2022-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we separate the diagnostics by severity and then overlay the Vec of spans for each severity on top of the highlights. The error diagnostics end up overlaid on the warning diagnostics, which are overlaid on the hints, overlaid on info, overlaid on any other severity (default), then overlaid on the syntax highlights. This fixes two things: * Error diagnostics are now always visible when overlapped with other diagnostics. * Ghost text is eliminated. * Ghost text was caused by duplicate diagnostics at the EOF: overlaps within the merged `Vec<(usize, Range<usize>)>` violate assumptions in `helix_core::syntax::Merge`. * When we push a new range, we check it against the last range and merge the two if they overlap. This is safe because they both have the same severity and therefore highlight. The actual merge is skipped for any of these when they are empty, so this is very fast in practice. For some data, I threw together an FPS counter which renders as fast as possible and logs the renders per second. With no diagnostics, I see an FPS gain from this change from 868 FPS to 878 (+1.1%) on a release build on a Rust file. On an Erlang file with 12 error diagnostics and 6 warnings in view (233 errors and 66 warnings total), I see a decrease in average FPS from 795 to 790 (-0.6%) on a release build.
* remove filterting with C-space from pickerPascal Kuthe2022-10-11
|
* Treat space as a seperator instead of a character in fuzzy pickerPascal Kuthe2022-10-11
|
* 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.
* picker: Highlight the document on idle timeoutBlaž Hrastnik2022-10-11
|
* Propagate idle timeout event to components (#3172)Gokul Soumya2022-10-11
|
* Add cursorcolumn (#4084)A-Walrus2022-10-08
| | | | | | | | | | | | | | | * Implement cursorcolumn * Add documentation * Separate column style from line with fallback * Fallback to cursorcolumn first * Switch to non-fallback try_get_exact Add new function `try_get_exact`, which doesn't perform fallback, and use that instead because the fallback behaviour is being handled manually.
* Automatically track pseudo-pending text (#4077)Michael Davis2022-10-03
| | | | | | | | | | | | | | | | | | This change automatically tracks pending text for for commands which use on-next-key callbacks. For example, `t` will await the next key event and "t" will be shown in the bottom right-hand corner to show that we're in a pending state. Previously, the text for these on-next-key commands needed to be hard-coded into the command definition which had some drawbacks: * It was easy to forget to write and clear the pending text. * If a command was remapped in a custom config, the pending text would still show the old key. With this change, pending text is automatically tracked based on the key events that lead to the command being executed. This works even when the command is remapped in config and when the on-next-key callback is nested under some key sequence (for example `mi`).
* Add option to skip the first indent guide (#3819)Robin2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | * Add option to skip the first indent guide * reorder skip_first option * change indent-guides.skip_first to a number * rename skip -> skip_levels * add skip_levels to the book * Update book/src/configuration.md Co-authored-by: A-Walrus <58790821+A-Walrus@users.noreply.github.com> * Update helix-term/src/ui/editor.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> Co-authored-by: Robin <robinvandijk@klippa.com> Co-authored-by: A-Walrus <58790821+A-Walrus@users.noreply.github.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Fix signature help panic when too large (#4030)Ivan Tham2022-10-03
| | | | | When signature help is too large it may cause a panic when it is too large, now I just make the hover do an intersection with surface to make sure it never overflow.
* feat(statusline): add option to show total line numbers in file (#3960)Joshua Pauline2022-10-03
| | | | | * feat(statusline): add option to show total line numbers in file * feat(line numbers): add config to doc book
* Add configureable statusline mode names (#3311)PeepNSheep2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added 'long-mode' statusline element * Added customizable statusline mode names * Removed a string clone * Added documentation * Updated documentation, moved modenames to a seperate section * Update configuration.md * Documentation update * Documentation update * Documentation update * Update configuration.md * Update configuration.md * Fixed merge error * Update configuration.md * Update configuration.md
* Add `ui.gutter.selected` option for themes (#3303)ChrHorn2022-10-03
| | | | | * add `ui.gutter.selected` * add `ui.gutter`, `ui.gutter.selected` to docs
* Cycled to end/beginning + no more matches msgs (#3176)A-Walrus2022-10-03
| | | | | | | | | * Show status msg when next/prev cycles around * Add msg when there is no wraparound * Cleanup code * Change msg to "Wrapped around document"
* Show "Invalid regex" message on enter (Validate) (#3049)A-Walrus2022-10-03
| | | | | | | | | | | * Show "Invalid regex" message on enter (Validate) * Reset selection on invalid regex * Add popup for invalid regex * Replace set_position with position * Make popup auto close
* chore: remove unneeded attribute after MSRV bump to 1.61 (#3961)Poliorcetics2022-09-25
|
* Document MSRV policy (#3913)Pascal Kuthe2022-09-23
|
* Fix preview bug (#3644)Joe2022-09-20
| | | | | * Fix preview bug * Add comment to empty case
* Render html <code> tags as code in markdown (#3425)A-Walrus2022-09-13
|
* Add `text` to language completerA-Walrus2022-09-10
|
* Remove LspNotDefined, instead return an Option<>Blaž Hrastnik2022-09-07
|
* Fix cargo doc warnings, and add GitHub action to ensure it (#3650)A-Walrus2022-09-03
|
* Expand doc/view macros to allow fetching specific idBlaž Hrastnik2022-09-03
| | | | This simplifies the code and hides away unwraps
* initial implementation of bufferline (#2759)aaron4042022-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial implementation of bufferline * fixed lint * changed to 'bufferline', added enum for config modes, some cleanup * fixed lint * added file modification indicator * removed redundant code, added proper themeing with fallback, changed 'file modified' indicator * remove commented code * Update helix-term/src/ui/editor.rs simplify text and offset computation Co-authored-by: Gokul Soumya <gokulps15@gmail.com> * add ui.bufferline.background key for themes Co-authored-by: lazytanuki <43273245+lazytanuki@users.noreply.github.com> * address PR comments * Update helix-term/src/ui/editor.rs * simplify computation of editor area: * change to set_stringn to avoid overflow * Update configuration.md Updates documentation to reflect decision re: defaulting to never showing bufferline. * addressed pr comments * fix build error * address pr comments * revert accidental change Co-authored-by: Gokul Soumya <gokulps15@gmail.com> Co-authored-by: lazytanuki <43273245+lazytanuki@users.noreply.github.com> Co-authored-by: Seth Bromberger <sbromberger@users.noreply.github.com>
* Fix closing buffer with custom keymap (#3633)A-Walrus2022-09-01
| | | | | * Fix closing buffer with custom keymap * Add comment explaining if
* Make mode editor-wide rather than per-documentBlaž Hrastnik2022-09-01
|
* fix: prevents storing last prompt if is top of stack (#3609)Saber Haj Rabiee2022-09-01
|
* Fix Prompt::handle_event compilationMichael Davis2022-08-31
|
* 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>
* Avoid command execution hooks on closed docs (#3613)Michael Davis2022-08-31
| | | | | | | | | Fixes a panic with a config like: [keys.normal.space] x = [":buffer-close"] by bailing out of the command-execution handling if the document doesn't exist after handling a command.
* Move mode transition logic to handle_keymap_event() (#2634)Lucy2022-08-31
| | | | | Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Use the original document and view for mode transition hooks (#3508)Michael Davis2022-08-31
| | | | | | | When changing focus, the lookup with `current!` may change the view and end up executing mode transition hooks on the newly focused view. We should use the same view and document to execute mode transition hooks so that switching away from a view triggers history save points.
* fix: Recalculate completion after pasting into promptBlaž Hrastnik2022-08-30
|
* 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).
* 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.
* Add bracketed paste (#3233)Charlie Groves2022-08-29
|
* Fix markdown indented code block rendering (#3503)Clay2022-08-24
|
* fix: Reset document mode when losing focusBlaž Hrastnik2022-08-23
| | | | Fixes #3090