Skip to content

Commit 66f6a4d

Browse files
authored
Merge pull request #5 from dark0dave/fix/fileview
fix(fileview): Removed fileview by mistake fixed
2 parents a2345fe + 4b0fac2 commit 66f6a4d

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

cmd/file-view.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@ func (f fileview) Init() tea.Cmd {
7575

7676
func (f fileview) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
7777
switch msg := msg.(type) {
78-
case ContentMsg:
79-
f.content = string(msg)
80-
f.viewport.SetContent(f.content)
81-
return f, nil
8278
case TitleMsg:
8379
f.title = string(msg)
8480
return f, nil
81+
case ContentMsg:
82+
f.content = string(msg)
83+
f.viewport.SetContent(f.content)
84+
return f, f.Init()
8585
case PathMsg:
8686
content, title := GetFileContents(string(msg))
8787
f.content = content
8888
f.viewport.SetContent(f.content)
8989
f.title = title
90-
return f, nil
90+
return f, f.Init()
9191
case tea.KeyMsg:
9292
switch msg.String() {
9393
case "q", "esc":

cmd/initial.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ func (i initial) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6868
d := NewDirectoryPicker(true, "Select a Mod Directory")
6969
f := NewDirectoryPicker(false, "Select an area to start")
7070
t := NewTree()
71-
state.SetNextCommand(d).SetNextCommand(f).SetNextCommand(t)
71+
v := NewFileView()
72+
state.SetNextCommand(d).SetNextCommand(f).SetNextCommand(t).SetNextCommand(v)
7273
return state.SetAndGetNextCommand(i), sendSelectedFile(current_path)
7374
case "Discover":
7475
d := NewDirectoryPicker(true, "Select a Mod Directory")

cmd/list-varriables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (l listVariables) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
131131
}
132132
title := strings.Join(l.table.SelectedRow()[:3], " ")
133133
state.setCurrentCommand(l)
134-
return state.NextCommand(), tea.Batch(sendTitleCmd(title), sendContentCmd(content))
134+
return state.NextCommand(), tea.Sequence(sendTitleCmd(title), sendContentCmd(content))
135135
}
136136
}
137137
var cmd tea.Cmd

0 commit comments

Comments
 (0)