Skip to content

Commit ddf0d2a

Browse files
committed
press
1 parent ab682a5 commit ddf0d2a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cquery-tree.el

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@
262262
(interactive)
263263
(-when-let* ((workspace lsp--cur-workspace)
264264
(node (cquery-tree--node-at-point))
265-
(win (get-buffer-window cquery-tree--origin-buffer)))
266-
(with-selected-window win
265+
(_ (window-live-p cquery-tree--origin-win)))
266+
(with-selected-window cquery-tree--origin-win
267267
(when split-fn
268268
(funcall split-fn))
269269
(find-file (car (cquery-tree-node-location node)))
@@ -281,22 +281,22 @@
281281
"Switch window and jump to the location."
282282
(interactive)
283283
(cquery-tree-press)
284-
(when-let* ((win (get-buffer-window cquery-tree--origin-buffer)))
285-
(select-window win)))
284+
(when (window-live-p cquery-tree--origin-win)
285+
(select-window cquery-tree--origin-win)))
286286

287287
(defun cquery-tree-press-and-horizontal-split ()
288288
"Split window horizontally and jump to the location."
289289
(interactive)
290290
(cquery-tree-press #'split-window-horizontally)
291-
(when-let* ((win (get-buffer-window cquery-tree--origin-buffer)))
292-
(select-window win)))
291+
(when (window-live-p cquery-tree--origin-win)
292+
(select-window cquery-tree--origin-win)))
293293

294294
(defun cquery-tree-press-and-vertical-split ()
295295
"Split window vertically and jump to the location."
296296
(interactive)
297297
(cquery-tree-press #'split-window-vertically)
298-
(when-let* ((win (get-buffer-window cquery-tree--origin-buffer)))
299-
(select-window win)))
298+
(when (window-live-p cquery-tree--origin-win)
299+
(select-window cquery-tree--origin-win)))
300300

301301
(defun cquery-tree-next-line (&optional arg)
302302
(interactive "p")

0 commit comments

Comments
 (0)