Skip to content

Fix fuzzy search over marks with telescope - #12

Merged
fnune merged 6 commits into
fnune:mainfrom
Danthewaann:fix-fuzzy-search
Dec 16, 2025
Merged

fnune merged 6 commits into
fnune:mainfrom
Danthewaann:fix-fuzzy-search

Conversation

@Danthewaann

Copy link
Copy Markdown
Contributor

Fixes #11

The ordinal value should be the same as the display value to support fuzzy search.

I also added some extra info (mark character and line number) to each entry to make them more unique incase you have multiple marks set in a single file e.g. A:/Users/me/Workspace/notes.md:1.

@fnune fnune left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but would appreciate the legibility change if it does work. You can merge once that's done or you find it doesn't work the way I suggested.

Comment thread lua/recall/telescope.lua Resolved
Comment thread lua/recall/telescope.lua Resolved
@fnune

fnune commented Dec 16, 2025

Copy link
Copy Markdown
Owner

Looks like I added tests for this 👀 unexpected.

            Passed in:
            (string) 'A'
            Expected:
            (string) 'A:/tmp/nvim-recall-test-47775321633.txt:1'

@fnune

fnune commented Dec 16, 2025

Copy link
Copy Markdown
Owner

@Danthewaann before we merge (and sorry about backtracking): isn't this an absolute path? Should we default to a path relative to Neovim's content root path?

@Danthewaann

Copy link
Copy Markdown
Contributor Author

@Danthewaann before we merge (and sorry about backtracking): isn't this an absolute path? Should we default to a path relative to Neovim's content root path?

Do you mean instead of creating test files under /var we should create them in a tmp folder in the current working directory instead?

@fnune

fnune commented Dec 16, 2025

Copy link
Copy Markdown
Owner

I'm suggesting a change in the actual functionality: instead of showing A:/Users/me/Workspace/notes.md:1 we should show a relative path to the content root, e.g. if Neovim was launched in /Users/me/Workspace we would show A:notes.md:1.

@Danthewaann

Copy link
Copy Markdown
Contributor Author

Would doing this break global marks for files that are outside of the directory where neovim was launched? We could check if each file is relative to the current directory before converting it to a relative path. If a file isn't relative to the current directory we still render it as an absolute path so nothing breaks?

@Danthewaann

Copy link
Copy Markdown
Contributor Author

@fnune I've pushed up commit 296cacc which include the changes to support rendering relative and absolute filenames for marks in telescope. Let me know if it looks reasonable.

@fnune

fnune commented Dec 16, 2025

Copy link
Copy Markdown
Owner

Lints are failing, but once that's good let's merge?

@fnune
fnune merged commit 147d6cf into fnune:main Dec 16, 2025
2 checks passed
@fnune

fnune commented Dec 16, 2025

Copy link
Copy Markdown
Owner

Thanks @Danthewaann !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable general fuzzy search for marks with telescope

2 participants