mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
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:
+6
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user