Clicking backlinks in side buffer behavior

When I click backlinks in the side buffer, it opens the link in the side buffer rather than in the main buffer window to the left. I can navigate as intended using the C-u RET on a backlink in the side buffer, but how do I do this via the mouse?

Using org-roam-ui mode is a lot easier with the mouse to navigate around.

Thanks!

Does this in the wiki work for you? If not, you can try something along the line of this:

(define-key org-roam-mode-map [mouse-1] #'org-roam-preview-visit)

Unfortunately no. I tried the wiki version earlier and tried the new one; in both cases the link is followed successfully but it directs to the target in the side buffer, not the main window. This causes me to have to collapse the windows C-x 1 then open up a new side buffer, which is not great

You can influence this in your configuration but that’s probably too complicated for me to explain – mine actually opens a link in the main buffer.

You might like to try the following and let us know how you go. It works on my end.

It may not work if you are using Doom, which has its own way of dealing with pop-up windows…

(defun my/org-roam-preview-other-window ()
  (interactive)
  (org-roam-preview-visit 
   (org-roam-buffer-file-at-point 'assert)
   (oref (magit-current-section) point)
   :other-window))

(define-key org-roam-mode-map [mouse-1] #'my/org-roam-preview-other-window)
1 Like

Thank you! I can confirm the snippet above is successful. Perhaps a good candidate for inclusion in the documentation?