fix selection with wide unicode chars
This commit is contained in:
parent
6c8dd2edbe
commit
59b45f57c3
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ impl Editor {
|
||||||
print!("{}", text.replace('\t', &" ".repeat(TAB_SIZE)));
|
print!("{}", text.replace('\t', &" ".repeat(TAB_SIZE)));
|
||||||
} else {
|
} else {
|
||||||
let mut in_selection = false;
|
let mut in_selection = false;
|
||||||
for (i, char) in text.chars().enumerate() {
|
for (i, char) in text.char_indices() {
|
||||||
let char_i = line.start + i;
|
let char_i = line.start + i;
|
||||||
if char_i >= selection.start && char_i <= selection.end && !in_selection {
|
if char_i >= selection.start && char_i <= selection.end && !in_selection {
|
||||||
color_selection();
|
color_selection();
|
||||||
|
|
Loading…
Reference in a new issue