mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
Open file buffers through command arguments
This commit is contained in:
+3
-5
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user