Skip to content

Commit

Permalink
Improve zk-index-forward-button
Browse files Browse the repository at this point in the history
Selects original zk-index window more reliably
  • Loading branch information
localauthor committed Oct 6, 2024
1 parent d96990a commit 4ffa129
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions zk-index.el
Original file line number Diff line number Diff line change
Expand Up @@ -656,18 +656,16 @@ Takes an option POS position argument."
"Move to the Nth next button, or Nth previous button if N is negative.
If `zk-index-auto-scroll' is non-nil, show note in other window."
(let ((split-width-threshold nil)
(index-name zk-index-buffer-name))
(index-window (get-buffer-window
zk-index-buffer-name)))
(if zk-index-auto-scroll
(progn
(cond ((not (zk-file-p)))
(zk-index-view--kill
(kill-buffer)
(select-window (get-buffer-window
index-name)))
((not zk-index-view--kill)
(zk-index-view-mode)
(select-window (get-buffer-window
index-name))))
(when (and (zk-file-p)
index-window)
(if zk-index-view--kill
(kill-buffer)
(zk-index-view-mode -1))
(select-window index-window))
(forward-button N)
(hl-line-highlight)
(unless (looking-at-p "[[:space:]]*$")
Expand Down

0 comments on commit 4ffa129

Please sign in to comment.