micro icon indicating copy to clipboard operation
micro copied to clipboard

FEATURE REQUEST - $(cols) special directive for statusline

Open michaelbwright opened this issue 3 years ago • 5 comments

Feature request for a "$(cols)" statusline special directive (variable) that would show the number of columns on the current line (similar to the "$(lines)" special directive that shows the number of lines in the current file).

michaelbwright avatar Nov 02 '22 16:11 michaelbwright

Since we provide lines by default, we could also provide cols? It's up to the maintainers if this should be an included feature.

In any case, this can be achieved with a lua script using SetStatusInfoFn() https://github.com/zyedidia/micro/blob/f97cba34d2bc8a59503de3f2fe5cc70ddbecf220/runtime/help/plugins.md?plain=1#L140-L141

cutelisp avatar Jul 26 '25 08:07 cutelisp

Since we provide lines by default, we could also provide cols? It's up to the maintainers if this should be an included feature.

Why not.

dmaluka avatar Jul 26 '25 13:07 dmaluka

Why not.

Right, I'll make a PR. On the same topic, the modified variable is tied to both the modified and readonly logic. A dirty buffer never shows the readonly flag even if it is enabled. Would it be better to separate them, or is there a reason for this behavior?

cutelisp avatar Jul 27 '25 07:07 cutelisp

IMO yes, why not separate them. I'm not aware of any particular reason for this behavior. I don't see any discussion of that in #1486.

dmaluka avatar Jul 27 '25 09:07 dmaluka

Why not.

Where would cols be created, go side or on status plugin? This reminds me of https://github.com/zyedidia/micro/discussions/3746

cutelisp avatar Jul 28 '25 08:07 cutelisp