micro icon indicating copy to clipboard operation
micro copied to clipboard

The value for the "clipboard" option doesn't show up on status bar

Open kernkraft235 opened this issue 3 months ago • 1 comments

The status of the clipboard shows null when used as a status bar item via adding $(opt:clipboard) to statusformatr or statusformatl

It will show properly if you set the clipboard option during that session, but when you exit and return it goes back to showing null.

The clipboard itself works as expected, this is not an issue with the clipboard functionality

macOS micro Version: 2.0.14, Commit hash: 04c57704 Proxmox micro version 2.0.11

Image

https://github.com/user-attachments/assets/1f53a22a-8df8-4e0e-ba09-05f755db0cf9

kernkraft235 avatar Oct 27 '25 21:10 kernkraft235

We need to check the global-only options for the statusline, since they aren't stored locally:

diff --git a/internal/display/statusline.go b/internal/display/statusline.go
index 409f862c..6f7f3fcc 100644
--- a/internal/display/statusline.go
+++ b/internal/display/statusline.go
@@ -100,6 +100,9 @@ func (s *StatusLine) FindOpt(opt string) any {
        if val, ok := s.win.Buf.Settings[opt]; ok {
                return val
        }
+       if val, ok := config.DefaultGlobalOnlySettings[opt]; ok {
+               return config.GlobalSettings[opt]
+       }
        return "null"
 }

JoeKar avatar Oct 28 '25 20:10 JoeKar