mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 14:14:17 +00:00
Don't allow users to set notes on local files
This commit is contained in:
parent
3d1adeec52
commit
7b6c3b3740
2 changed files with 6 additions and 6 deletions
|
@ -183,8 +183,8 @@ func pagerUpdate(msg tea.Msg, m pagerModel) (pagerModel, tea.Cmd) {
|
|||
return m, nil
|
||||
}
|
||||
case "m":
|
||||
// Users can't set the note on news markdown
|
||||
if m.currentDocument.markdownType == newsMarkdown {
|
||||
// Users can only set the note on user-stashed markdown
|
||||
if m.currentDocument.markdownType != userMarkdown {
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
@ -524,9 +524,9 @@ func stashPopulatedView(m stashModel) string {
|
|||
|
||||
func stashHelpView(m stashModel) string {
|
||||
var (
|
||||
h []string
|
||||
md = m.selectedMarkdown()
|
||||
isNews = md != nil && md.markdownType == newsMarkdown
|
||||
h []string
|
||||
md = m.selectedMarkdown()
|
||||
isStashed = md != nil && md.markdownType == userMarkdown
|
||||
)
|
||||
|
||||
if m.state == stashStateSettingNote {
|
||||
|
@ -541,7 +541,7 @@ func stashHelpView(m stashModel) string {
|
|||
if m.paginator.TotalPages > 1 {
|
||||
h = append(h, "h/l, ←/→: page")
|
||||
}
|
||||
if !isNews && len(m.markdowns) > 0 {
|
||||
if isStashed && len(m.markdowns) > 0 {
|
||||
h = append(h, []string{"x: delete", "m: set memo"}...)
|
||||
}
|
||||
h = append(h, []string{"esc: exit"}...)
|
||||
|
|
Loading…
Reference in a new issue