Open file buffers through command arguments

This commit is contained in:
2025-06-03 17:21:14 +03:00
parent 6b5e6e8996
commit 2f7f483563
2 changed files with 26 additions and 6 deletions
+3 -5
View File
@@ -19,23 +19,21 @@ type TextArea struct {
CurrentBuffer *Buffer
}
func CreateWindow(initialBuffer *Buffer) (*Window, error) {
func CreateWindow() (*Window, error) {
window := Window{
ShowTopMenu: true,
ShowLineIndex: true,
textArea: TextArea{
CursorPos: 0,
CurrentBuffer: initialBuffer,
CurrentBuffer: nil,
},
screen: nil,
}
// Create empty buffer if nil
if window.textArea.CurrentBuffer == nil {
window.textArea.CurrentBuffer = CreateBuffer("New File")
}
window.textArea.CurrentBuffer = CreateBuffer("New File")
// Create tcell screen
screen, err := tcell.NewScreen()