File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,12 @@ func RenderFileView(m model.Model) string {
5858 }
5959
6060 // Build minimal controls; extra controls go in Help view
61- controls := []string {"[↑/↓] navigate" , "[space] stage/unstage" , "[x] discard changes" }
61+ controls := []string {"[↑/↓] navigate" , "[space] stage/unstage" }
62+
63+ // Only offer discard option when there are modified files to discard
64+ if len (m .Files ) > 0 {
65+ controls = append (controls , "[x] discard changes" )
66+ }
6267
6368 if stagedCount > 0 {
6469 controls = append (controls , "[c] commit" )
@@ -69,6 +74,7 @@ func RenderFileView(m model.Model) string {
6974 controlsLine := " " + strings .Join (controls , " " )
7075
7176 s .WriteString ("\n " + styles .BorderStyle .Render (
77+ //
7278 styles .HelpStyle .Render ("Controls:\n " )+
7379 styles .HelpStyle .Render (controlsLine ),
7480 ))
You can’t perform that action at this time.
0 commit comments