diff --git a/ui/pager.go b/ui/pager.go index 9ae6462..8e88528 100644 --- a/ui/pager.go +++ b/ui/pager.go @@ -19,11 +19,7 @@ import ( te "github.com/muesli/termenv" ) -const ( - statusBarHeight = 1 - noteHeadingText = " Set Memo " - notePromptText = " > " -) +const statusBarHeight = 1 var ( pagerHelpHeight int @@ -31,7 +27,7 @@ var ( mintGreen = common.NewColorPair("#89F0CB", "#89F0CB") darkGreen = common.NewColorPair("#1C8760", "#1C8760") - noteHeading = te.String(noteHeadingText). + noteHeading = te.String(" Set Memo "). Foreground(common.Cream.Color()). Background(common.Green.Color()). String() @@ -100,7 +96,7 @@ func newPagerModel(cfg *Config, as authStatus) pagerModel { // Text input for notes/memos ti := textinput.NewModel() - ti.Prompt = te.String(notePromptText). + ti.Prompt = te.String(" > "). Foreground(common.Color(darkGray)). Background(common.YellowGreen.Color()). String() @@ -132,7 +128,9 @@ func (m *pagerModel) setSize(w, h int) { m.height = h m.viewport.Width = w m.viewport.Height = h - statusBarHeight - m.textInput.Width = w - len(noteHeadingText) - len(notePromptText) - 1 + m.textInput.Width = w - + ansi.PrintableRuneWidth(noteHeading) - + ansi.PrintableRuneWidth(m.textInput.Prompt) - 1 if m.showHelp { if pagerHelpHeight == 0 { diff --git a/ui/stash.go b/ui/stash.go index 9377cab..fd305b6 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -29,8 +29,6 @@ const ( stashViewTopPadding = 5 stashViewBottomPadding = 4 stashViewHorizontalPadding = 6 - setNotePromptText = "Memo: " - searchNotePromptText = "Search: " ) var ( @@ -127,8 +125,8 @@ func (m *stashModel) setSize(width, height int) { // Update the paginator m.setTotalPages() - m.noteInput.Width = m.terminalWidth - stashViewHorizontalPadding*2 - len(setNotePromptText) - m.searchInput.Width = m.terminalWidth - stashViewHorizontalPadding*2 - len(searchNotePromptText) + m.noteInput.Width = m.terminalWidth - stashViewHorizontalPadding*2 - ansi.PrintableRuneWidth(m.noteInput.Prompt) + m.searchInput.Width = m.terminalWidth - stashViewHorizontalPadding*2 - ansi.PrintableRuneWidth(m.searchInput.Prompt) } // Sets the total paginator pages according to the amount of markdowns for the @@ -319,13 +317,13 @@ func newStashModel(cfg *Config, as authStatus) stashModel { p.InactiveDot = common.Subtle("•") ni := textinput.NewModel() - ni.Prompt = stashTextInputPromptStyle(setNotePromptText) + ni.Prompt = stashTextInputPromptStyle("Memo: ") ni.CursorColor = common.Fuschia.String() ni.CharLimit = noteCharacterLimit ni.Focus() si := textinput.NewModel() - si.Prompt = stashTextInputPromptStyle(searchNotePromptText) + si.Prompt = stashTextInputPromptStyle("Search: ") si.CursorColor = common.Fuschia.String() si.CharLimit = noteCharacterLimit si.Focus()