Skip to content

fix(links): creating link from visual mode#1139

Merged
kristijanhusak merged 1 commit into
nvim-orgmode:masterfrom
lanker:lanker/link.create
May 5, 2026
Merged

fix(links): creating link from visual mode#1139
kristijanhusak merged 1 commit into
nvim-orgmode:masterfrom
lanker:lanker/link.create

Conversation

@lanker
Copy link
Copy Markdown
Contributor

@lanker lanker commented May 4, 2026

Summary

Selecting a region from right to left could lead to insert_from > insert_to, which isn't handled in later code. By using getregionpos the regions will be in the correct order.

Related Issues

Closes #900

Changes

  • Switched from using plain getpos to using getregionpos

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.

@lanker
Copy link
Copy Markdown
Contributor Author

lanker commented May 4, 2026

Did some digging and it seems like the failing test runs on nightly are due to neovim/neovim@7ed5609

Selecting a region from right to left could lead to insert_from >
insert_to, which isn't handled in later code. By using getregionpos the
regions will be in the correct order.
Copy link
Copy Markdown
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 1a9d7bc into nvim-orgmode:master May 5, 2026
11 checks passed
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.

Creating links in visual mode doesn't work if selecting the text backwards

2 participants