mirror of https://github.com/helix-editor/helix
Compare commits
4 Commits
f68e1865b3
...
c77ebbe6be
Author | SHA1 | Date |
---|---|---|
|
c77ebbe6be | |
|
395a71bf53 | |
|
1e4bf6704a | |
|
183a561f1b |
|
@ -6661,9 +6661,20 @@ fn jump_to_label(cx: &mut Context, labels: Vec<Range>, behaviour: Movement) {
|
|||
if labels.is_empty() {
|
||||
return;
|
||||
}
|
||||
let alphabet_char = |i| {
|
||||
let alphabet_char = |i, use_fullwidth: bool| {
|
||||
let mut res = Tendril::new();
|
||||
res.push(alphabet[i]);
|
||||
let ch = alphabet[i];
|
||||
// Use full-width characters for wide characters to prevent rendering issues
|
||||
let display_ch = if use_fullwidth {
|
||||
match ch {
|
||||
'a'..='z' => char::from_u32(ch as u32 - 'a' as u32 + 'a' as u32).unwrap_or(ch),
|
||||
'A'..='Z' => char::from_u32(ch as u32 - 'A' as u32 + 'A' as u32).unwrap_or(ch),
|
||||
_ => ch,
|
||||
}
|
||||
} else {
|
||||
ch
|
||||
};
|
||||
res.push(display_ch);
|
||||
res
|
||||
};
|
||||
|
||||
|
@ -6673,11 +6684,13 @@ fn jump_to_label(cx: &mut Context, labels: Vec<Range>, behaviour: Movement) {
|
|||
.iter()
|
||||
.enumerate()
|
||||
.flat_map(|(i, range)| {
|
||||
let pos = range.from();
|
||||
let use_fullwidth = text.char(pos).width().unwrap_or(1) >= 2;
|
||||
[
|
||||
Overlay::new(range.from(), alphabet_char(i / alphabet.len())),
|
||||
Overlay::new(pos, alphabet_char(i / alphabet.len(), use_fullwidth)),
|
||||
Overlay::new(
|
||||
graphemes::next_grapheme_boundary(text, range.from()),
|
||||
alphabet_char(i % alphabet.len()),
|
||||
graphemes::next_grapheme_boundary(text, pos),
|
||||
alphabet_char(i % alphabet.len(), use_fullwidth),
|
||||
),
|
||||
]
|
||||
})
|
||||
|
|
|
@ -1022,6 +1022,7 @@ shebangs = []
|
|||
comment-token = "#"
|
||||
language-servers = [ "nil", "nixd" ]
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
formatter = { command = "nixfmt" }
|
||||
|
||||
[[grammar]]
|
||||
name = "nix"
|
||||
|
@ -4243,10 +4244,11 @@ comment-token = "#"
|
|||
block-comment-tokens = ["#-", "-#"]
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
language-servers = ["koto-ls"]
|
||||
formatter = {command = "koto", args = ["--format"]}
|
||||
|
||||
[[grammar]]
|
||||
name = "koto"
|
||||
source = { git = "https://github.com/koto-lang/tree-sitter-koto", rev = "b420f7922d0d74905fd0d771e5b83be9ee8a8a9a" }
|
||||
source = { git = "https://github.com/koto-lang/tree-sitter-koto", rev = "2ffc77c14f0ac1674384ff629bfc207b9c57ed89" }
|
||||
|
||||
[[language]]
|
||||
name = "gpr"
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"^"
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"/="
|
||||
"%="
|
||||
"^="
|
||||
"=="
|
||||
"!="
|
||||
"<"
|
||||
|
@ -99,12 +101,18 @@
|
|||
(export
|
||||
(identifier) @namespace)
|
||||
|
||||
(call
|
||||
function: (identifier) @function.method)
|
||||
(chain
|
||||
start: (identifier) @function)
|
||||
|
||||
(chain
|
||||
lookup: (identifier) @variable.other.member)
|
||||
|
||||
(call
|
||||
function: (identifier)) @function
|
||||
|
||||
(call_arg
|
||||
(identifier) @variable.other.member)
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
|
@ -139,13 +147,10 @@
|
|||
|
||||
(self) @variable.builtin
|
||||
|
||||
(variable
|
||||
type: (identifier) @type)
|
||||
(type
|
||||
_ @type)
|
||||
|
||||
(arg
|
||||
(_ (identifier) @variable.parameter))
|
||||
|
||||
(ellipsis) @variable.parameter
|
||||
|
||||
(function
|
||||
output_type: (identifier) @type)
|
||||
|
|
|
@ -11,10 +11,6 @@
|
|||
(call_args
|
||||
((call_arg) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(chain
|
||||
call: (tuple
|
||||
((element) @parameter.inside . ","? @parameter.around) @parameter.around))
|
||||
|
||||
(map
|
||||
((entry_inline) @entry.inside . ","? @entry.around) @entry.around)
|
||||
|
||||
|
|
Loading…
Reference in New Issue