Skip to content

Commit ed646be

Browse files
committed
Update core to fixed indexing.
1 parent 0353ffe commit ed646be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

multi-shell.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@
128128
(setq multi-shell--live-shells (reverse multi-shell--live-shells))
129129
(dolist (sp multi-shell--live-shells)
130130
(with-current-buffer (cdr sp)
131-
(let ((shell-id (multi-shell--name-to-id (buffer-name))))
131+
(let* ((shell-id (multi-shell--name-to-id (buffer-name)))
132+
(new-shell-id (1- shell-id)))
132133
(when (>= shell-id killed-id)
133-
(rename-buffer
134-
(multi-shell--form-name-by-id (1- shell-id)))))))
134+
(rename-buffer (multi-shell--form-name-by-id new-shell-id))))))
135+
(let ((index 0))
136+
(dolist (sp multi-shell--live-shells)
137+
(let ((new-id (multi-shell--name-to-id (with-current-buffer (cdr sp) (buffer-name)))))
138+
(setf (nth index multi-shell--live-shells) (cons new-id (cdr sp))))
139+
(setq index (1+ index))))
135140
(setq multi-shell--live-shells (reverse multi-shell--live-shells)))
136141

137142
;;;###autoload

0 commit comments

Comments
 (0)