Compare commits

...

3 Commits

Author SHA1 Message Date
Takumi Matsuura 3eb2dc4150
Merge 183a561f1b into 4281228da3 2025-07-25 08:44:42 +09:00
Valtteri Koskivuori 4281228da3
fix(queries): Fix filesystem permissions for snakemake (#14061) 2025-07-24 13:09:40 -04:00
Takumi Matsuura 183a561f1b Fix jump label rendering for multi-byte characters 2025-06-07 12:32:02 +09:00
7 changed files with 18 additions and 5 deletions

View File

@ -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 + '' as u32).unwrap_or(ch),
'A'..='Z' => char::from_u32(ch as u32 - 'A' as u32 + '' 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),
),
]
})

0
runtime/queries/snakemake/LICENSE 100755 → 100644
View File

View File

View File

View File

View File

View File