Skip to content

fix: preserve prefix in blink.cmp org directive completions #978

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 12, 2025

Conversation

seflue
Copy link
Contributor

@seflue seflue commented May 10, 2025

Summary

This PR fixes a bug where blink.cmp autocompletion incorrectly removes the #+ prefix when completing org directives. When typing #+fi and selecting #+filetype from the completion menu, the completion would incorrectly insert just filetype instead of #+filetype.

Related Issues

This PR addresses the bug described in my bug report #977 .

Changes

  • Fixed the get_completions function in lua/orgmode/org/autocompletion/blink.lua to preserve the #+ prefix for org directives
  • Added a test case in tests/plenary/org/autocompletion_spec.lua to verify that #+ prefixes are preserved when completing org directives
  • The fix ensures that other completion types (tags, headlines, etc.) continue to work as before while only affecting org directive completions

Checklist

I confirm that I have:

  • Followed the
    Conventional Commits
    specification
    (e.g., feat: add new feature, fix: correct bug,
    docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with
    make test.
  • Checked for breaking changes and documented them, if any.

Copy link
Member

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

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

Works great, but lets move logic around a bit.

@seflue seflue force-pushed the fix-blink-completion branch from 4c893b9 to 5fcf165 Compare May 12, 2025 06:33
@seflue seflue requested a review from kristijanhusak May 12, 2025 06:37
Copy link
Member

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

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

Thanks!

@kristijanhusak kristijanhusak merged commit c720d9c into nvim-orgmode:master May 12, 2025
20 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants