Skip to content

Commit

Permalink
temporary fix for not showing the unresolved reference under the cursor
Browse files Browse the repository at this point in the history
when prompting for completions
  • Loading branch information
Feel-ix-343 committed Mar 8, 2024
1 parent 243080f commit 87c4225
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ pub fn get_completions(
items: matches
.into_iter()
.take(30)
.filter(|(MatchableReferenceable(_, name), _)| {
*name != String::from_iter(filter_text)
.filter(|(MatchableReferenceable(r, name), _)| {
!(*name == String::from_iter(filter_text) && matches!(r, Referenceable::UnresovledFile(..) | Referenceable::UnresolvedHeading(..) | Referenceable::UnresovledIndexedBlock(..)))
})
.filter_map(|(MatchableReferenceable(referenceable, _), rank)| {
default_completion_item(
Expand Down Expand Up @@ -378,7 +378,9 @@ pub fn get_completions(
items: matches
.into_iter()
.take(50)
.filter(|(MatchableReferenceable(_, name), _)| *name != inputted_refname)
.filter(|(MatchableReferenceable(r, name), _)|
!(*name == inputted_refname && matches!(r, Referenceable::UnresovledFile(..) | Referenceable::UnresolvedHeading(..) | Referenceable::UnresovledIndexedBlock(..)))
)
.flat_map(|(MatchableReferenceable(referenceable, _), rank)| {
default_completion_item(
vault,
Expand Down

0 comments on commit 87c4225

Please sign in to comment.