From 4db01b3f82010665984c2fde01dafa26cb9a73e9 Mon Sep 17 00:00:00 2001 From: bootradev <91094662+bootradev@users.noreply.github.com> Date: Mon, 25 Jul 2022 14:33:15 -0400 Subject: [PATCH 001/150] add support for rulers to boo_berry theme (#3191) --- runtime/themes/boo_berry.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/themes/boo_berry.toml b/runtime/themes/boo_berry.toml index a79b75c5..1509a1dc 100644 --- a/runtime/themes/boo_berry.toml +++ b/runtime/themes/boo_berry.toml @@ -45,6 +45,7 @@ "ui.menu.selected" = { fg = "mint", bg = "berry_saturated" } "ui.selection" = { bg = "berry_saturated" } "ui.virtual.whitespace" = { fg = "berry_desaturated" } +"ui.virtual.ruler" = { bg ="berry_desaturated" } "diff.plus" = { fg = "mint" } "diff.delta" = { fg = "gold" } From 73a308c6654cb600d811c2883f038a1e11efeed9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Jul 2022 08:17:14 +0800 Subject: [PATCH 002/150] build(deps): bump serde from 1.0.139 to 1.0.140 (#3194) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.139 to 1.0.140. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.139...v1.0.140) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb94d1e0..802bf8ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -885,18 +885,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" dependencies = [ "proc-macro2", "quote", From b7fa9ba6014f3253ec4ed56dd35d6ee29af36638 Mon Sep 17 00:00:00 2001 From: bootra <91094662+bootradev@users.noreply.github.com> Date: Mon, 25 Jul 2022 20:33:53 -0400 Subject: [PATCH 003/150] Fix non-msvc grammar compile on Windows (#3190) --- helix-loader/src/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index 7aa9bc83..3a8a4918 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -319,7 +319,7 @@ fn build_tree_sitter_library(src_path: &Path, grammar: GrammarConfiguration) -> command.env(key, value); } - if cfg!(windows) { + if cfg!(all(windows, target_env = "msvc")) { command .args(&["/nologo", "/LD", "/I"]) .arg(header_path) From 235237ddc45d398f5121f3a27ce6afb1d0ef570b Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Tue, 26 Jul 2022 02:40:38 +0200 Subject: [PATCH 004/150] Refactor 'helix-loader::merge_toml_values' to use a 'merge-depth' instead of 'merge_toplevel_arrays' (#3080) - This ensures that other values than just the arrays are overridden, like nested objects, where it makes sense - merge_depth is set to 3 so that top-level language features are merged (like 'scope'), but everything deeper is overridden with the user-config --- helix-loader/src/config.rs | 18 +++++++++++++++++- helix-loader/src/lib.rs | 36 ++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/helix-loader/src/config.rs b/helix-loader/src/config.rs index a8c84361..259b1318 100644 --- a/helix-loader/src/config.rs +++ b/helix-loader/src/config.rs @@ -19,7 +19,23 @@ pub fn user_lang_config() -> Result { .into_iter() .chain([default_lang_config()].into_iter()) .fold(toml::Value::Table(toml::value::Table::default()), |a, b| { - crate::merge_toml_values(b, a, true) + // combines for example + // b: + // [[language]] + // name = "toml" + // language-server = { command = "taplo", args = ["lsp", "stdio"] } + // + // a: + // [[language]] + // language-server = { command = "/usr/bin/taplo" } + // + // into: + // [[language]] + // name = "toml" + // language-server = { command = "/usr/bin/taplo" } + // + // thus it overrides the third depth-level of b with values of a if they exist, but otherwise merges their values + crate::merge_toml_values(b, a, 3) }); Ok(config) diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index ff4414b2..1ba48e7b 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -113,11 +113,7 @@ pub fn find_root_impl(root: Option<&str>, root_markers: &[String]) -> Vec toml::Value { +pub fn merge_toml_values(left: toml::Value, right: toml::Value, merge_depth: usize) -> toml::Value { use toml::Value; fn get_name(v: &Value) -> Option<&str> { @@ -131,7 +127,7 @@ pub fn merge_toml_values( // that you can specify a sub-set of languages in an overriding // `languages.toml` but that nested arrays like Language Server // arguments are replaced instead of merged. - if merge_toplevel_arrays { + if merge_depth > 0 { left_items.reserve(right_items.len()); for rvalue in right_items { let lvalue = get_name(&rvalue) @@ -140,7 +136,7 @@ pub fn merge_toml_values( }) .map(|lpos| left_items.remove(lpos)); let mvalue = match lvalue { - Some(lvalue) => merge_toml_values(lvalue, rvalue, false), + Some(lvalue) => merge_toml_values(lvalue, rvalue, merge_depth - 1), None => rvalue, }; left_items.push(mvalue); @@ -151,18 +147,22 @@ pub fn merge_toml_values( } } (Value::Table(mut left_map), Value::Table(right_map)) => { - for (rname, rvalue) in right_map { - match left_map.remove(&rname) { - Some(lvalue) => { - let merged_value = merge_toml_values(lvalue, rvalue, merge_toplevel_arrays); - left_map.insert(rname, merged_value); - } - None => { - left_map.insert(rname, rvalue); + if merge_depth > 0 { + for (rname, rvalue) in right_map { + match left_map.remove(&rname) { + Some(lvalue) => { + let merged_value = merge_toml_values(lvalue, rvalue, merge_depth - 1); + left_map.insert(rname, merged_value); + } + None => { + left_map.insert(rname, rvalue); + } } } + Value::Table(left_map) + } else { + Value::Table(right_map) } - Value::Table(left_map) } // Catch everything else we didn't handle, and use the right value (_, value) => value, @@ -187,7 +187,7 @@ mod merge_toml_tests { .expect("Couldn't parse built-in languages config"); let user: Value = toml::from_str(USER).unwrap(); - let merged = merge_toml_values(base, user, true); + let merged = merge_toml_values(base, user, 3); let languages = merged.get("language").unwrap().as_array().unwrap(); let nix = languages .iter() @@ -220,7 +220,7 @@ mod merge_toml_tests { .expect("Couldn't parse built-in languages config"); let user: Value = toml::from_str(USER).unwrap(); - let merged = merge_toml_values(base, user, true); + let merged = merge_toml_values(base, user, 3); let languages = merged.get("language").unwrap().as_array().unwrap(); let ts = languages .iter() From cb142b5750fd23a9937034558663c1b5203fead4 Mon Sep 17 00:00:00 2001 From: A-Walrus <58790821+A-Walrus@users.noreply.github.com> Date: Tue, 26 Jul 2022 03:40:56 +0300 Subject: [PATCH 005/150] Highlight constructor in monokai theme (#3131) --- runtime/themes/monokai.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/themes/monokai.toml b/runtime/themes/monokai.toml index 5a890615..2d11601c 100644 --- a/runtime/themes/monokai.toml +++ b/runtime/themes/monokai.toml @@ -6,7 +6,7 @@ "type" = { fg = "type" } "type.builtin" = { fg = "#66D9EF" } "type.enum.variant" = { fg = "text" } -"constructor" = { fg = "text" } +"constructor" = { fg = "fn_declaration" } "variable.other.member" = { fg = "variable" } "keyword" = { fg = "keyword" } From d0c63409ccb9eae332e7dea5788f54f1af412d5a Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 25 Jul 2022 20:41:09 -0400 Subject: [PATCH 006/150] Add table of contents to keymap.md (#3174) --- book/src/keymap.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 9acbd3b6..25f1943d 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -1,7 +1,27 @@ # Keymap -- Mappings marked (**LSP**) require an active language server for the file. -- Mappings marked (**TS**) require a tree-sitter grammar for the filetype. +- [Normal mode](#normal-mode) + - [Movement](#movement) + - [Changes](#changes) + - [Shell](#shell) + - [Selection manipulation](#selection-manipulation) + - [Search](#search) + - [Minor modes](#minor-modes) + - [View mode](#view-mode) + - [Goto mode](#goto-mode) + - [Match mode](#match-mode) + - [Window mode](#window-mode) + - [Space mode](#space-mode) + - [Popup](#popup) + - [Unimpaired](#unimpaired) +- [Insert Mode](#insert-mode) +- [Select / extend mode](#select--extend-mode) +- [Picker](#picker) +- [Prompt](#prompt) + +> πŸ’‘ Mappings marked (**LSP**) require an active language server for the file. + +> πŸ’‘ Mappings marked (**TS**) require a tree-sitter grammar for the filetype. ## Normal mode @@ -337,7 +357,7 @@ mode before pressing `n` or `N` makes it possible to keep the current selection. Toggling it on and off during your iterative searching allows you to selectively add search terms to your selections. -# Picker +## Picker Keys to use within picker. Remapping currently not supported. @@ -356,7 +376,7 @@ Keys to use within picker. Remapping currently not supported. | `Ctrl-t` | Toggle preview | | `Escape`, `Ctrl-c` | Close picker | -# Prompt +## Prompt Keys to use within prompt, Remapping currently not supported. From 742d16026eb288b93e334a92863bb46ec2b500e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Tue, 26 Jul 2022 02:05:27 +0100 Subject: [PATCH 007/150] Add ayu themes (#3184) --- runtime/themes/ayu_dark.toml | 77 ++++++++++++++++++++++++++++++++++ runtime/themes/ayu_light.toml | 77 ++++++++++++++++++++++++++++++++++ runtime/themes/ayu_mirage.toml | 77 ++++++++++++++++++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 runtime/themes/ayu_dark.toml create mode 100644 runtime/themes/ayu_light.toml create mode 100644 runtime/themes/ayu_mirage.toml diff --git a/runtime/themes/ayu_dark.toml b/runtime/themes/ayu_dark.toml new file mode 100644 index 00000000..2f5dd6f3 --- /dev/null +++ b/runtime/themes/ayu_dark.toml @@ -0,0 +1,77 @@ +# Author: AndrΓ© SΓ‘ +# Based on the AYU theme colors from https://github.com/dempfi/ayu + +# Syntax highlighting +"type" = { fg = "blue" } +"type.builtin" = { fg = "blue" } +"constructor" = { fg = "green" } +"constant" = { fg = "magenta" } +"string" = { fg = "green" } +"string.regexp" = { fg = "orange" } +"string.special" = { fg = "yellow" } +"comment" = { fg = "gray", modifiers = ["italic"] } +"variable" = { fg = "foreground" } +"variable.parameter" = { fg = "yellow" } +"label" = { fg = "orange" } +"punctuation" = { fg = "foreground" } +"keyword" = { fg = "orange" } +"keyword.control" = { fg = "yellow" } +"keyword.directive" = { fg = "yellow" } +"operator" = { fg = "orange" } +"function" = { fg = "yellow", modifiers = ["bold"] } +"tag" = { fg = "blue" } +"namespace" = { fg = "blue" } +"markup.heading" = { fg = "orange" } +"markup.list" = { fg = "yellow" } +"markup.raw.block" = { bg = "grey", fg = "orange" } +"markup.link.url" = { fg = "blue" } +"markup.link.text" = { fg = "yellow" } +"markup.link.label" = { fg = "green" } +"markup.quote" = { fg = "yellow" } +"diff.plus" = { fg = "green" } +"diff.minus" = { fg = "red" } +"diff.delta" = { fg = "green" } + +# Interface +"ui.background"= { bg = "background" } +"ui.cursor" = { bg = "yellow", fg = "dark_gray" } +"ui.cursor.match" = { fg = "orange" } +"ui.linenr" = { fg = "dark_gray" } +"ui.linenr.selected" = { fg = "orange" } +"ui.statusline" = { bg = "black" } +"ui.popup" = { bg = "black" } +"ui.window" = { fg = "dark_gray" } +"ui.help" = { bg = "black" } +"ui.text" = { fg = "foreground" } +"ui.text.focus" = { bg = "dark_gray", fg = "foreground" } +"ui.text.info" = { fg = "foreground" } +"ui.virtual.whitespace" = { fg = "dark_gray" } +"ui.virtual.ruler" = { bg = "black" } +"ui.menu" = { bg = "black" } +"ui.menu.selected" = { bg = "orange", fg = "background" } +"ui.selection" = { bg = "dark_gray" } +"warning" = { fg = "yellow" } +"error" = { fg = "red", modifiers = ["bold"] } +"info" = { fg = "blue", modifiers = ["bold"] } +"hint" = { fg = "blue", modifiers = ["bold"] } +"diagnostic"= { fg = "red", modifiers = ["underlined"] } +"diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } +"diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } +"diagnostic.error"= { fg = "red", modifiers = ["underlined"] } + +"special" = { fg = "orange" } + +[palette] +background = "#0f1419" +foreground = "#bfbdb6" + +black = "#131721" +blue = "#59c2ff" +dark_gray = "#2d3640" +cyan = "#73b8ff" +gray = "#5c6773" +green = "#aad94c" +magenta = "#d2a6ff" +orange = "#ff8f40" +red = "#f07178" +yellow = "#e6b450" diff --git a/runtime/themes/ayu_light.toml b/runtime/themes/ayu_light.toml new file mode 100644 index 00000000..feaff5be --- /dev/null +++ b/runtime/themes/ayu_light.toml @@ -0,0 +1,77 @@ +# Author: AndrΓ© SΓ‘ +# Based on the AYU theme colors from https://github.com/dempfi/ayu + +# Syntax highlighting +"type" = { fg = "blue" } +"type.builtin" = { fg = "blue" } +"constructor" = { fg = "green" } +"constant" = { fg = "magenta" } +"string" = { fg = "green" } +"string.regexp" = { fg = "orange" } +"string.special" = { fg = "yellow" } +"comment" = { fg = "gray", modifiers = ["italic"] } +"variable" = { fg = "foreground" } +"variable.parameter" = { fg = "yellow" } +"label" = { fg = "orange" } +"punctuation" = { fg = "foreground" } +"keyword" = { fg = "orange" } +"keyword.control" = { fg = "yellow" } +"keyword.directive" = { fg = "yellow" } +"operator" = { fg = "orange" } +"function" = { fg = "yellow", modifiers = ["bold"] } +"tag" = { fg = "blue" } +"namespace" = { fg = "blue" } +"markup.heading" = { fg = "orange" } +"markup.list" = { fg = "yellow" } +"markup.raw.block" = { bg = "grey", fg = "orange" } +"markup.link.url" = { fg = "blue" } +"markup.link.text" = { fg = "yellow" } +"markup.link.label" = { fg = "green" } +"markup.quote" = { fg = "yellow" } +"diff.plus" = { fg = "green" } +"diff.minus" = { fg = "red" } +"diff.delta" = { fg = "green" } + +# Interface +"ui.background"= { bg = "background" } +"ui.cursor" = { bg = "yellow", fg = "dark_gray" } +"ui.cursor.match" = { fg = "orange" } +"ui.linenr" = { fg = "dark_gray" } +"ui.linenr.selected" = { fg = "orange" } +"ui.statusline" = { bg = "black" } +"ui.popup" = { bg = "black" } +"ui.window" = { fg = "dark_gray" } +"ui.help" = { bg = "black" } +"ui.text" = { fg = "foreground" } +"ui.text.focus" = { bg = "dark_gray", fg = "foreground" } +"ui.text.info" = { fg = "foreground" } +"ui.virtual.whitespace" = { fg = "dark_gray" } +"ui.virtual.ruler" = { bg = "black" } +"ui.menu" = { bg = "black" } +"ui.menu.selected" = { bg = "orange", fg = "background" } +"ui.selection" = { bg = "dark_gray" } +"warning" = { fg = "yellow" } +"error" = { fg = "red", modifiers = ["bold"] } +"info" = { fg = "blue", modifiers = ["bold"] } +"hint" = { fg = "blue", modifiers = ["bold"] } +"diagnostic"= { fg = "red", modifiers = ["underlined"] } +"diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } +"diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } +"diagnostic.error"= { fg = "red", modifiers = ["underlined"] } + +"special" = { fg = "orange" } + +[palette] +background = "#fcfcfc" +foreground = "#5c6166" + +black = "#e7eaed" +blue = "#399ee6" +cyan = "#478acc" +dark_gray = "#e7eaed" +gray = "#787b8099" +green = "#86b300" +magenta = "#a37acc" +orange = "#fa8d3e" +red = "#f07171" +yellow = "#ffaa33" diff --git a/runtime/themes/ayu_mirage.toml b/runtime/themes/ayu_mirage.toml new file mode 100644 index 00000000..b2567e65 --- /dev/null +++ b/runtime/themes/ayu_mirage.toml @@ -0,0 +1,77 @@ +# Author: AndrΓ© SΓ‘ +# Based on the AYU theme colors from https://github.com/dempfi/ayu + +# Syntax highlighting +"type" = { fg = "blue" } +"type.builtin" = { fg = "blue" } +"constructor" = { fg = "green" } +"constant" = { fg = "magenta" } +"string" = { fg = "green" } +"string.regexp" = { fg = "orange" } +"string.special" = { fg = "yellow" } +"comment" = { fg = "gray", modifiers = ["italic"] } +"variable" = { fg = "foreground" } +"variable.parameter" = { fg = "yellow" } +"label" = { fg = "orange" } +"punctuation" = { fg = "foreground" } +"keyword" = { fg = "orange" } +"keyword.control" = { fg = "yellow" } +"keyword.directive" = { fg = "yellow" } +"operator" = { fg = "orange" } +"function" = { fg = "yellow", modifiers = ["bold"] } +"tag" = { fg = "blue" } +"namespace" = { fg = "blue" } +"markup.heading" = { fg = "orange" } +"markup.list" = { fg = "yellow" } +"markup.raw.block" = { bg = "grey", fg = "orange" } +"markup.link.url" = { fg = "blue" } +"markup.link.text" = { fg = "yellow" } +"markup.link.label" = { fg = "green" } +"markup.quote" = { fg = "yellow" } +"diff.plus" = { fg = "green" } +"diff.minus" = { fg = "red" } +"diff.delta" = { fg = "green" } + +# Interface +"ui.background"= { bg = "background" } +"ui.cursor" = { bg = "yellow", fg = "dark_gray" } +"ui.cursor.match" = { fg = "orange" } +"ui.linenr" = { fg = "dark_gray" } +"ui.linenr.selected" = { fg = "orange" } +"ui.statusline" = { bg = "black" } +"ui.popup" = { bg = "black" } +"ui.window" = { fg = "dark_gray" } +"ui.help" = { bg = "black" } +"ui.text" = { fg = "foreground" } +"ui.text.focus" = { bg = "dark_gray", fg = "foreground" } +"ui.text.info" = { fg = "foreground" } +"ui.virtual.whitespace" = { fg = "dark_gray" } +"ui.virtual.ruler" = { bg = "black" } +"ui.menu" = { bg = "black" } +"ui.menu.selected" = { bg = "orange", fg = "background" } +"ui.selection" = { bg = "dark_gray" } +"warning" = { fg = "yellow" } +"error" = { fg = "red", modifiers = ["bold"] } +"info" = { fg = "blue", modifiers = ["bold"] } +"hint" = { fg = "blue", modifiers = ["bold"] } +"diagnostic"= { fg = "red", modifiers = ["underlined"] } +"diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } +"diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } +"diagnostic.error"= { fg = "red", modifiers = ["underlined"] } + +"special" = { fg = "orange" } + +[palette] +background = "#242936" +foreground = "#cccac2" + +black = "#1a1f29" +blue = "#73d0ff" +dark_gray = "#8a919959" +cyan = "#80bfff" +gray = "#565b66" +green = "#d5ff80" +magenta = "#dfbfff" +orange = "#ffad66" +red = "#f28779" +yellow = "#ffcc77" From bfdcfec8c954225f79b49ce3e4db4bb76715ae69 Mon Sep 17 00:00:00 2001 From: Seth Bromberger Date: Tue, 26 Jul 2022 03:07:59 +0200 Subject: [PATCH 008/150] add spacer element to statusline (#3165) * add spacer element to statusline * docs --- book/src/configuration.md | 1 + helix-term/src/ui/statusline.rs | 8 ++++++++ helix-view/src/editor.rs | 3 +++ 3 files changed, 12 insertions(+) diff --git a/book/src/configuration.md b/book/src/configuration.md index 4eab4a48..c9f435bf 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -78,6 +78,7 @@ The following elements can be configured: | `diagnostics` | The number of warnings and/or errors | | `selections` | The number of active selections | | `position` | The cursor position | +| `spacer` | Inserts a space between elements (multiple/contiguous spacers may be specified) | ### `[editor.lsp]` Section diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 85992c60..e9e478bf 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -143,6 +143,7 @@ where helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics, helix_view::editor::StatusLineElement::Selections => render_selections, helix_view::editor::StatusLineElement::Position => render_position, + helix_view::editor::StatusLineElement::Spacer => render_spacer, } } @@ -334,3 +335,10 @@ where write(context, title, None); } + +fn render_spacer(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option