aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/theme.rs
Commit message (Collapse)AuthorAge
* Refactor toml::Value->Theme conversionMichael Davis2023-01-24
| | | | | | | | | | | | | | | | | The `From<Value>` implementation for `Theme` converted the Value to a string and re-parsed the string to convert it to `HashMap<String, Value>` which feels a bit wasteful. This change uses the underlying `toml::map::Map` directly when the value is a table and warns about the unexpected `Value` shape otherwise. This is necessary because toml 0.6.0 changes the Display implementation for Value::Table so that the `to_string` no longer encodes the value as a Document, just a Value. So the parse of the Value fails to be decoded as a HashMap. The behavior for returning `Default::default` matches the previous code's behavior except that it did not warn when the input Value was failed to parse.
* Fix compatibility with toml 0.6.0Michael Davis2023-01-24
| | | | | | | | | | | | | `toml::from_slice` has been removed. The CHANGELOG recommends using `toml::from_str` instead and doing the byte-to-str conversion yourself. The `toml::toml!` macro has also changed to return the type of the value declared within the macro body. In the change in `helix-view/src/theme.rs` this is a `toml::map::Map` (it was a `toml::Value` previously) allowing us to skip the match and use the map directly. Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Switch from toml::from_slice to toml::from_str (#5659)Pascal Kuthe2023-01-24
|
* Fix theme inheritance for default themes (#5218)jliaoh2022-12-30
|
* Improve error message handling for theme loading failures (#5073)Michael Davis2022-12-15
| | | | | | | | | | | | | | | | | The error messages for a theme that failed to be deserialized (or otherwise failed to load) were covered up by the context/with_context calls: * The log message for a bad theme configured in config.toml would only say "Failed to deserilaize theme" * Selecting a bad theme via :theme would show "Theme does not exist" With these changes, we let the TOML deserializer errors bubble up, so the error messages can now say the line number of a duplicated key - and that key's name - when a theme fails to load because of a duplicated key. Providing a theme which does not exist to :theme still gives a helpful error message: "No such file or directory."
* commands: Make no arg ':theme' show name (#3740)James O. D. Hunt2022-10-26
| | | | | | | | | | | | | | | | Most commands that accept an argument show their current value if no argument is specified. The `:theme` command previously displayed an error message in the status bar if not provided with an argument: ``` Theme name not provided ``` It now shows the current theme name in the status bar if no argument is specified. Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com> Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com>
* Merge pull request #4061 from pascalkuthe/undercurl-modifierBlaž Hrastnik2022-10-19
|\ | | | | Support different kinds of underline rendering (updated)
| * merge underline-style and underline-color into a single tablePascal Kuthe2022-10-13
| |
| * adress review commentsPascal Kuthe2022-10-11
| |
| * make casing consistent with other configurationPascal Kuthe2022-10-06
| |
| * make underline_style a seperate optionPascal Kuthe2022-10-01
| | | | | | | | | | | | | | | | | | | | 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.
| * Add separate color for underlinesA-Walrus2022-10-01
| |
* | 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.
* | Inherit theme (#3067)Christoph Schmidler2022-10-03
|/ | | | | | | | | | | | | | | | | | | * Add RawTheme to handle inheritance with theme palette * Add a intermediate step in theme loading it uses RawTheme struct to load the original ThemePalette, so we can merge it with the inherited one. * Load default themes via RawThemes, remove Theme deserialization * Allow naming custom theme same as inherited one * Remove RawTheme and use toml::Value directly * Resolve all review changes resulting in a cleaner code * Simplify return for Loader::load * Add implementation to avoid extra step for loading of base themes
* 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
* Fallback to broader scope if theme scope not found (#1714)Gokul Soumya2022-03-04
|
* Put some tests behind #[cfg(test)] (#1459)Benoît Cortier2022-01-08
| | | It was missing in a few places.
* Use `base16_tty` as 16-color default, fix theme nameOmnikar2021-12-13
|
* change to .unwrap_or_default() and fix ui.window and ui.statuslineNNB2021-12-13
|
* Update theme.rsNNB2021-12-13
|
* 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`
* Annotate Theme::highlight with #[inline]Blaž Hrastnik2021-12-01
|
* ui: Optimize tree-sitter style lookupsBlaž Hrastnik2021-12-01
| | | | | | | | | Tree sitter returns an index referring to the position of the scope in the scopes array. We can use that same index to avoid a hashmap lookup and instead store the styles in an array. This currently stores the styles in both a map and an array because the UI still uses hashmap lookups, but it's a reasonable tradeoff.
* Update to rust 1.56 + 2021 editionBlaž Hrastnik2021-10-22
|
* fix: Merge default palette with user paletteGokul Soumya2021-09-05
|
* feat: Default theme palette using 16 terminal colorsGokul Soumya2021-09-05
|
* Refactor theme parsing (#570)Gokul Soumya2021-08-12
|
* Color palettes (#393)Jakub Bartodziej2021-06-30
| | | | | | | | | | | | | | | | | | | * Enable using color palettes in theme files. * Add an example theme defined using a gruvbox color palette. * Fix clippy error. * Small style improvement. * Add documentation for the features to themes.md. * Update runtime/themes/gruvbox.toml Fix the value of purple0. Co-authored-by: DrZingo <DrZingo@users.noreply.github.com> Co-authored-by: DrZingo <DrZingo@users.noreply.github.com>
* Simplify selection rendering by injecting highlight scopesBlaž Hrastnik2021-06-27
|
* reverse the dependency between helix-tui and helix-view (#366)Keith Simmons2021-06-25
| | | | | | | | | * reverse the dependency between helix-tui and helix-view by moving a fiew types to view * fix tests * clippy and format fixes Co-authored-by: Keith Simmons <keithsim@microsoft.com>
* Add themes loaderwojciechkepka2021-06-19
|
* Add theme key for selected line numberGokul Soumya2021-06-16
| | | | | | | | | | | Adds `ui.linenr.selected` which controls highlight of linu numbes which have cursors on. - Fallback to linenr if linenr.selected is missing - Update docs and themes - Add TODOs for themes with temporary linenr.selected
* theme: Enable style modifiers in theme.toml, add Ingrid's theme (#113)Ingrid2021-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | * theme: Enable style modifiers in theme.toml * docs: theme documentation * fixup: parse modifiers with filter_map * theme: tests for parse_style * theme: Log invalid cases in theme.toml parse * docs: theme documentation fixup * docs: Blaz's theming comments * docs: Theme doc fixes from pickfire Co-authored-by: Ivan Tham <pickfire@riseup.net> * theme: More context in logs, TODO for alerting users * contrib: Ingrid's theme * docs: Theme subsection fixes Co-authored-by: Ivan Tham <pickfire@riseup.net>
* clippy lintBlaž Hrastnik2021-05-06
|
* Clippy lintBlaž Hrastnik2021-03-25
|
* Load theme from toml file.Blaž Hrastnik2021-03-25
|
* clippy lintsBlaž Hrastnik2021-03-22
|
* ui: Syntax highlight code inside markdown popups.Blaž Hrastnik2021-03-16
|
* Use diagnostic.severity to distinguish between error colors.Blaž Hrastnik2021-03-11
|
* popup: wip work on completion popupsBlaž Hrastnik2021-02-09
|
* Total mess but it works: diagnostic marking.Blaž Hrastnik2020-12-03
|
* clippy warningsBlaž Hrastnik2020-09-29
|
* Split parts of helix-term into helix-view.Blaž Hrastnik2020-09-21
It still largely depends on term for some types but I plan to change that later.