Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvim_eval_statusline() can return the default statusline #28444

Open
justinmk opened this issue Apr 21, 2024 · 1 comment
Open

nvim_eval_statusline() can return the default statusline #28444

justinmk opened this issue Apr 21, 2024 · 1 comment
Labels
api libnvim, Nvim RPC API complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md enhancement feature request needs:discussion For PRs that propose significant changes to some part of the architecture or API statusline tabline, winbar, statuscolumn
Milestone

Comments

@justinmk
Copy link
Member

Problem

An old limitation of N/Vim is that the default internal logic for empty 'statusline' option, is not exposed as a 'statusline' expression. We added nvim_eval_statusline() which is very nice, but still can't use it to get the default statusline result.

Expected behavior

nvim_eval_statusline() should be able to yield the default statusline. It could look like any of :

  • Passing empty string: nvim_eval_statusline('')
  • or, a new opts flag: nvim_eval_statusline('',{default=true, ...})
@justinmk justinmk added enhancement feature request api libnvim, Nvim RPC API statusline tabline, winbar, statuscolumn complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md labels Apr 21, 2024
@luukvbaal
Copy link
Contributor

luukvbaal commented Apr 21, 2024

Worth noting that the help for 'statusline' does mention what supposedly yields the default statusline:

Emulate standard status line with 'ruler' set
set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P

@justinmk justinmk added the needs:discussion For PRs that propose significant changes to some part of the architecture or API label Apr 21, 2024
@justinmk justinmk added this to the unplanned milestone Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md enhancement feature request needs:discussion For PRs that propose significant changes to some part of the architecture or API statusline tabline, winbar, statuscolumn
Projects
None yet
Development

No branches or pull requests

2 participants