From a1f3499825730eaf69da6fd501ff0bcac9f55113 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sun, 22 Oct 2017 19:51:16 -0400 Subject: [PATCH] Fix issue with multicursor IDs Fixes #899 --- cmd/micro/buffer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/micro/buffer.go b/cmd/micro/buffer.go index 67a6c73b..db207338 100644 --- a/cmd/micro/buffer.go +++ b/cmd/micro/buffer.go @@ -349,6 +349,14 @@ func (b *Buffer) MergeCursors() { } b.cursors = cursors + + for i := range b.cursors { + b.cursors[i].Num = i + } + + if b.curCursor >= len(b.cursors) { + b.curCursor = len(b.cursors) - 1 + } } func (b *Buffer) UpdateCursors() {