Change how buffers are handled, fix PgDn key binding running prev-buffer command, fix next/prev-buffer not working correctly

This commit is contained in:
2025-06-14 11:38:02 +03:00
parent 51ec45cd14
commit 12495d4bd9
7 changed files with 82 additions and 52 deletions
+6 -2
View File
@@ -4,6 +4,7 @@ import (
"github.com/gdamore/tcell/v2"
"log"
"slices"
"strconv"
"strings"
"time"
"unicode"
@@ -52,8 +53,11 @@ func CreateWindow() (*Window, error) {
}
// Create empty buffer if nil
if window.CurrentBuffer == nil {
window.CurrentBuffer = CreateBuffer("New File 1")
for i := 1; window.CurrentBuffer == nil; i++ {
buffer, err := CreateBuffer("New Buffer " + strconv.Itoa(i))
if err == nil {
window.CurrentBuffer = buffer
}
}
// Create tcell screen