summaryrefslogtreecommitdiff
path: root/support/texlab/crates/completion/src
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-28 03:00:53 +0000
committerNorbert Preining <norbert@preining.info>2024-01-28 03:00:53 +0000
commit7084e3008c8fc947579f46c6b8a08dfd180e72ef (patch)
tree9c99041cba4afefac3859d6a2fe4cea289458468 /support/texlab/crates/completion/src
parentb93d257f657e619e22b8b7a27446118ce041727e (diff)
CTAN sync 202401280300
Diffstat (limited to 'support/texlab/crates/completion/src')
-rw-r--r--support/texlab/crates/completion/src/providers/include.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/support/texlab/crates/completion/src/providers/include.rs b/support/texlab/crates/completion/src/providers/include.rs
index 2dd204cfdc..f8bb55dfeb 100644
--- a/support/texlab/crates/completion/src/providers/include.rs
+++ b/support/texlab/crates/completion/src/providers/include.rs
@@ -87,7 +87,7 @@ pub fn complete_includes<'a>(
if let Some(score) = builder.matcher.score(&name, segment_text) {
builder.items.push(CompletionItem::new_simple(
score,
- cursor.range,
+ segment_range,
CompletionItemData::File(name),
));
}
@@ -96,7 +96,7 @@ pub fn complete_includes<'a>(
if let Some(score) = builder.matcher.score(&name, segment_text) {
builder.items.push(CompletionItem::new_simple(
score,
- cursor.range,
+ segment_range,
CompletionItemData::Directory(name),
));
}
@@ -121,11 +121,12 @@ fn current_dir(
let path = workspace.current_dir(&parent.dir).to_file_path().ok()?;
let mut path = PathBuf::from(path.to_str()?.replace('\\', "/"));
- if !path_text.is_empty() {
- if let Some(graphics_path) = graphics_path {
- path.push(graphics_path);
- }
+ if let Some(graphics_path) = graphics_path {
+ path.push(graphics_path);
+ }
+
+ if !path_text.is_empty() {
path.push(path_text);
if !path_text.ends_with('/') {
path.pop();