File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -656,18 +656,16 @@ Takes an option POS position argument."
656
656
" Move to the Nth next button, or Nth previous button if N is negative.
657
657
If `zk-index-auto-scroll' is non-nil, show note in other window."
658
658
(let ((split-width-threshold nil )
659
- (index-name zk-index-buffer-name))
659
+ (index-window (get-buffer-window
660
+ zk-index-buffer-name)))
660
661
(if zk-index-auto-scroll
661
662
(progn
662
- (cond ((not (zk-file-p)))
663
- (zk-index-view--kill
664
- (kill-buffer )
665
- (select-window (get-buffer-window
666
- index-name)))
667
- ((not zk-index-view--kill)
668
- (zk-index-view-mode)
669
- (select-window (get-buffer-window
670
- index-name))))
663
+ (when (and (zk-file-p)
664
+ index-window)
665
+ (if zk-index-view--kill
666
+ (kill-buffer )
667
+ (zk-index-view-mode -1 ))
668
+ (select-window index-window))
671
669
(forward-button N)
672
670
(hl-line-highlight )
673
671
(unless (looking-at-p " [[:space:]]*$" )
You can’t perform that action at this time.
0 commit comments