Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lsp): goto_line_backward abs_pos #1280

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lsp/src/string_zipper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ let drop_until from until =
| [] -> empty
| current :: left ->
let rel_pos = Substring.length current in
let abs_pos = from.rel_pos + rel_pos in
let abs_pos = from.abs_pos + rel_pos in
{ from with right; left; current; rel_pos; abs_pos })

let add_buffer_between b start stop =
Expand Down
2 changes: 1 addition & 1 deletion lsp/test/string_zipper_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ let%expect_test "drop_until bug" =
"foo\nbar\n|" |}];
printfn "abs_pos: %d" (String_zipper.Private.reflect t).abs_pos;
[%expect {|
abs_pos: 16 |}]
abs_pos: 8 |}]
Loading