Underline styles are mutally exclusive and overwrite each other.
Therefore implementing as an modifier lead to incorrect behaviour
when the underline style is overwritten.
For backwards compatability the "underline" modified is retained (but
deprecated). Instead the "underline_style" and "underline_color"
optios should be used to style underlines.
The cxterminfo crate has been used over popular alternatives
like `term` since it supports querying for extended capabilities
and also for it's small codebase size (which will make it easy
to inline it into helix in the future if required).
* 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
* 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>
* Truncate the starts of file paths in picker
* Simplify the truncate implementation
* Break loop at appropriate point
* Fix alignment and ellipsis presence
* Remove extraneous usage of `x_offset`
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>