jgru/consult-org-roam

[BUG] cursor moved when previewing the same buffer and the first item is far from the current cursor

Closed this issue · 5 comments

(require 'org-roam)
(require 'vertico)
(require 'consult)
(require 'consult-org-roam)
(consult-org-roam-mode 1)
(vertico-mode 1)
(setq consult-preview-key 'any)
:PROPERTIES:
:ID:       5f19bb99-cac4-4fff-a607-b6b2ee58fe70
:END:
#+title: test

* heading1
:PROPERTIES:
:ID:       6c640360-7e68-40d3-93c2-19d466071591
:END:
[contents longer than the buffer]

* heading2
:PROPERTIES:
:ID:       02a0aea1-27d7-477f-852e-f8d1437998f3
:END:
[cursor]

The above is a minimal example code and org file. If you place the cursor at the end of the buffer, and then invoke org-roam-node-insert, and then search for "test" item, the previewing function of consult will let you see the title of this buffer, and the cursor will be moved away from its original position. Then if you hit enter, the item will not be inserted to the expected position.

jgru commented

Hi @K-gihu,

thanks for your message. I could reproduce the issue. Indeed, the insertion point is not saved correctly in some cases.
I addressed this in a7d5100. I am pretty sure that this fixes the bug but I want to ask for confirmation before closing this issue.

Best regards,
jgru

Hi @jgru,
thanks for your quick reply and fixing. It is confirmed that the bug has been addressed with the a7d5100 commit.

Best regards,
K-gihu

jgru commented

It is confirmed that the bug has been addressed with the a7d5100 commit.

Thank you for the prompt confirmation, @K-gihu.
I hope you enjoy using the package.

Best regards,
jgru

Hi @jgru,

It seems to me that this problem is back after pulling the latest commit, and the commit a7d5100 can still fix my problem, and it is not apllied to the latest commit as far as I can see.

Best regards,
K-gihu

jgru commented

Hi @K-gihu,

thank you very much for your notice and reopening the issue.
Indeed, there has been an issue on my side (while working to fix issue #24).
I am very sorry for the inconvenience and pushed the respective commit to fix the issue.

Best regards,
jgru