mirror of
https://github.com/shokinn/hosts-go.git
synced 2025-08-23 16:43:02 +00:00
Add edit mode toggle and entry activation
This commit is contained in:
parent
0c60248d75
commit
51966f766c
6 changed files with 69 additions and 17 deletions
|
@ -47,7 +47,11 @@ func (m Model) View() string {
|
|||
|
||||
// join panes and status bar
|
||||
panes := lipgloss.JoinHorizontal(lipgloss.Top, left, right)
|
||||
status := fmt.Sprintf("VIEW MODE • %d entries", len(m.hosts.Entries))
|
||||
modeLabel := "VIEW"
|
||||
if m.mode == EditMode {
|
||||
modeLabel = "EDIT"
|
||||
}
|
||||
status := fmt.Sprintf("%s MODE • %d entries", modeLabel, len(m.hosts.Entries))
|
||||
bar := statusStyle.Width(m.width).Render(status)
|
||||
return lipgloss.JoinVertical(lipgloss.Left, panes, bar)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue