Re: [vim/vim] Feature Request: can use setbufvar() to set window options before buffer has a window (Issue #21089)
Mao-Yining (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/21089/[email protected]> |
mao-yining left a comment (vim/vim#21089)
> The documentation states that the "a local to window" option cannot be changed using setbufvar().
The docuement states that window "variable" can't be changed. 'number' is an "option". Scope to document, nothing reject what I am expecting.
> Since there are no window numbers or window IDs, I assume that is simply how it works. What do you think?
Seems when a buffer has no windows can't set that value.
However, how do it remember its previous windows option?
```vim
vim9script
set number
var bufnr = bufadd(null_string)
execute $'new +{bufnr}buffer'
setbufvar(bufnr, "&number", false)
quit
execute $'new +{bufnr}buffer'
echo &g:number bufnr->getbufvar('&number') bufnr
```
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/21089#issuecomment-5350017316
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/issues/21089/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/21089/5350017316%40github.com.