-
Notifications
You must be signed in to change notification settings - Fork 143
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
For completion, default to links/aliases, make leading #/^ complete for anchors/blocks #589
Comments
Hey @linduxed, I like the idea of only giving header/anchor link completion when the current prompt ends with |
@linduxed I just opened a PR for this. Can you test this out? |
Hello @epwalsh! Thank you for the very quick response and code! I checked out the PR locally and tested. Observations:
|
Oh, wait, my bad:
I misunderstood. That seems to work. In that case, I guess my only relevant observation is the part about aliases not being shown. |
Further observations upon closer inspection:
|
Question: how is one to reference headers in the same document with this PR, excluding writing out the name of the current note and then the header (i.e. in a note called |
Would you want me to move some of the content in my previous messages to the PR thread, to have it all in context there? |
This patch includes a revert of the changes in commit 60dde3d. The changes introduced in `v3.7.0` pertaining to searching/completion for anchors/headers/blocks were introduced in such a way that it breaks the workflow that resembled the one found in Obsidian, i.e. completing with either note names or aliases for them. Now, aliases are somewhat broken (they're there, but they're not inserted as link text properly) and the anchor data slows completion down and makes the results more messy. Discussion with the plugin author is currently ongoing in a GitHub [issue][1] and its related PRs: 1: epwalsh/obsidian.nvim#589 In 60dde3d, the configuration for `obsidian.nvim` was updated to comply with the format that can be seen in `v3.7.x`, where it was previously written for `v3.6.x`. This commit should be reverted once the issues with the latest plugin versions have been addressed.
This patch includes a revert of the changes in commit 60dde3d. The changes introduced in `v3.7.0` pertaining to searching/completion for anchors/headers/blocks were introduced in such a way that it breaks the workflow that resembled the one found in Obsidian, i.e. completing with either note names or aliases for them. Now, aliases are somewhat broken (they're there, but they're not inserted as link text properly) and the anchor data slows completion down and makes the results more messy. Discussion with the plugin author is currently ongoing in a GitHub [issue][1] and its related PRs: 1: epwalsh/obsidian.nvim#589 In 60dde3d, the configuration for `obsidian.nvim` was updated to comply with the format that can be seen in `v3.7.x`, where it was previously written for `v3.6.x`. This commit should be reverted once the issues with the latest plugin versions have been addressed.
* Only collect anchors/blocks when prompted in completion Closes #589. * changelog
馃殌 The feature, motivation and pitch
Since
v3.7.0
, the addition of support for anchor and block search has resulted in the default behavior of the completion to change.Previously typing
[[
would (after a configurable amount of characters) initiate search among the note names and their aliases, much like how Obsidian works. The recent addition of the support for anchors and blocks changes two things:[[
for initiating a completion different than note names and aliases ([[#
for headings in the current note,[[##
in all notes;[[^
for blocks in this note, and[[^^
in all notes).While having the ability to get completion for anchors and blocks is useful, to both be more in line with the working of Obsidian, and to avoid the performance penalty of always completing for everything (notes, aliases, anchors, and blocks), would it be a good idea to introduce a similar kind of prefix detection (i.e. looking for something like
[[#
) to the completion triggering?Alternatives
An alternative would be making it possible to disable the anchor and block completion, to go back to the previous way things worked. The README made me think that this should be possible by changing the
wiki_link_func
config opt, but (unless I've missed something) this does not seem to do the trick.Additional context
No response
The text was updated successfully, but these errors were encountered: