From 243080f2c2c565018fa616686b38d52aa60a1e0c Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Fri, 8 Mar 2024 12:19:06 -0500 Subject: [PATCH] Fix markdown completions with wikilinks on the same line --- src/completion.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/completion.rs b/src/completion.rs index a0d11c1d..80b45308 100644 --- a/src/completion.rs +++ b/src/completion.rs @@ -25,7 +25,7 @@ use crate::{ }; fn get_wikilink_index(line: &Vec, cursor_character: usize) -> Option { - line.get(0..=cursor_character)? // select only the characters up to the cursor + let index = line.get(0..=cursor_character)? // select only the characters up to the cursor .iter() .enumerate() // attach indexes .tuple_windows() // window into pairs of characters @@ -33,7 +33,15 @@ fn get_wikilink_index(line: &Vec, cursor_character: usize) -> Option