mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-22 20:25:00 +00:00
fix: shifted completion cursor
This commit is contained in:
parent
1d230f409d
commit
e6a1397c20
1 changed files with 1 additions and 3 deletions
|
@ -16,9 +16,7 @@ impl CompletionRequest {
|
|||
) -> Option<CompletionResponse> {
|
||||
let doc = doc.as_deref();
|
||||
let source = get_suitable_source_in_workspace(world, &self.path).ok()?;
|
||||
let offset = lsp_to_typst::position(self.position, position_encoding, &source)?;
|
||||
// the typst's cursor is 1-based, so we need to add 1 to the offset
|
||||
let cursor = offset + 1;
|
||||
let cursor = lsp_to_typst::position(self.position, position_encoding, &source)?;
|
||||
|
||||
let (offset, completions) =
|
||||
typst_ide::autocomplete(world, doc, &source, cursor, self.explicit)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue