mirror of https://github.com/kdl-org/kdl-rs.git
Merge e56b6c1cba into 01183642a7
This commit is contained in:
commit
dd453c78b0
|
|
@ -160,6 +160,7 @@ impl LanguageServer for Backend {
|
|||
}
|
||||
|
||||
fn char_to_position(char_idx: usize, rope: &Rope) -> Position {
|
||||
let char_idx = char_idx.min(rope.len_chars());
|
||||
let line_idx = rope.char_to_line(char_idx);
|
||||
let line_char_idx = rope.line_to_char(line_idx);
|
||||
let column_idx = char_idx - line_char_idx;
|
||||
|
|
|
|||
Loading…
Reference in New Issue