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

Bug: Does not remove old results on refresh #16

Closed
usernotnull opened this issue May 8, 2023 · 8 comments
Closed

Bug: Does not remove old results on refresh #16

usernotnull opened this issue May 8, 2023 · 8 comments
Labels
bug Something isn't working pending Pending closure. Closed once a new release has been published

Comments

@usernotnull
Copy link
Contributor

usernotnull commented May 8, 2023

Clicking on the Scroll into View button does not work most of the time.
I tried to change the theme or Reading/Edit view, but it didn't help.

Same issue with "Go to Source" for the suggestions. It opens the correct file but does not scroll to the occurrence (unless that is by design, but it's hard to know where in the source the word is). The "go to source" should in theory open the file and scroll to the word to find if the occurrence is meaningful.

** Edit: I have pinpointed the issue of the Scroll into View of the first case. Scrolling does not work if the word is found inside a callout quote.

@usernotnull usernotnull added the triage Requires triage label May 8, 2023
@shoedler
Copy link
Owner

Hey @usernotnull
I can't reproduce this issue. Please provide further information as per the Bug report template.

@usernotnull usernotnull changed the title Bug: Scroll into view not working Bug: Does not remove old results on refresh May 18, 2023
@usernotnull
Copy link
Contributor Author

usernotnull commented May 18, 2023

Hey @shoedler,

Took me some time to figure out the issue; below is a step-by-step reproduction:

  1. Create a new vault, install crossbow, then open crossbow with no files created

  2. Create File1 with:

# A Beautiful Apartment
  1. Create File2 with:
# Some title

I have an Apartment
  1. Go to file1 and add "2" as below:
# A Beautiful Apartment2
  1. Observe issue: the previous heading was not removed from crossbow result:
image
  1. Observe another issue: the line number in all suggestions is always less by 1 (2:10 should be 3:10). Same applies for the caret placement. Maybe it's an issue with array indexes starting with 0? But UI-wise, you can see obsidian number is different than crossbow so better align with it and add +1 to both line and caret. (I won't dare opening another issue I opened enough already 😄)

  2. Create File3 with:

My Apartment is big.
  1. Wait 2600ms (default value for auto-refresh)... Same issue as above, suggesting the old heading that doesn't exist.

Waiting for auto-refresh does not work. The only way is to completely close Obsidian and reopen it.

@shoedler shoedler added bug Something isn't working and removed triage Requires triage labels May 20, 2023
@shoedler
Copy link
Owner

Hey again - thanks for your detailed reproduction steps.
I've looked into this and came up with a good fix (I also fixed the line- and caret number being wrong). I'll merge it today, but I won't release a new version just yet.
I've attached a "insider" build which contains the fix - feel free to test it if you don't want to wait for the release.
I'll keep this issue open until the changes have been released.

obsidian-1.2.1.insider.zip

@shoedler
Copy link
Owner

I've actually found a bug in the old cache system. You couldn't have e.g. identical headings in separate files show up in the suggestions, since the one that was indexed last overrode the previous keys. So I've refactored the cache system some more and added a subtitle to the suggestions which show the file source.

There's still some minor issues with the new approach. For example, if you have a heading in a file with the same name as the filename, it'd override the possible suggestion for a file. Same goes for tags. I'll keep it like this until I find a better solution, since the new implementation is pretty fast.

@shoedler
Copy link
Owner

Here's the new "Insider" build:
obsidian-1.2.1.insider2.zip

@shoedler shoedler added the pending Pending closure. Closed once a new release has been published label May 20, 2023
@shoedler shoedler reopened this May 20, 2023
@usernotnull
Copy link
Contributor Author

@shoedler If you need me to test it before public release, let me know when everything is implemented so I can thoroughly test it through the final draft of the insider build 👍🏼

@shoedler
Copy link
Owner

@usernotnull Thanks for your offer! I'm pretty confident about the system except for the issues recorded in #22.
However, if you find anything on top of that, be sure to open another issue.

@shoedler
Copy link
Owner

Fixed in Release 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending Pending closure. Closed once a new release has been published
Projects
None yet
Development

No branches or pull requests

2 participants