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

Buffer options not when opening a file #72

Open
saccarosium opened this issue Jan 18, 2025 · 0 comments
Open

Buffer options not when opening a file #72

saccarosium opened this issue Jan 18, 2025 · 0 comments
Labels
bug issues reporting wrong behavior vim vim specific issues

Comments

@saccarosium
Copy link
Owner

Problem

I've been banging my head against this for a few hours. Figured i'd ask

Here is a small reproduction: https://github.com/eanyanwu/neovim-bug
Its a single init.lua file that creates a buffer and set some buffer local options

Here are the contents of the file for posterity:

local gb = vim.api.nvim_create_buf(false, false)
vim.api.nvim_buf_set_option(gb, "buftype", "nofile")
vim.api.nvim_buf_set_option(gb, "filetype", "alist")
vim.api.nvim_buf_set_option(gb, "modeline", false)
print(gb)

Open neovim like this: nvim -u neovim-bug/init.lua . (note the period at the end)

Steps to reproduce

git clone https://github.com/eanyanwu/neovim-bug.git
nvim -u neovim-bug/init.lua .
:set filetype?
:set buftype?

Expected behavior

I would expect that the newly created buffer should have the options that it set.

If i go to it using buffer <id>, then type set filetype?, i expect that to be "alist". But it is empty. Same for set buftype?

The odd thing is that if I just do nvim -u neovim-bug/init.lua instead (without the period) ... i get the results i'd expect.

Am i missing something obvious?

Neovim version (nvim -v)

NVIM v0.9.5

Vim (not Nvim) behaves the same?

Not sure. I don't know enough vimscript XD

Operating system/version

Arch Linux

Terminal name/version

wezterm

$TERM environment variable

xterm-256color

Installation

Archlinux official package

original issue: neovim/neovim#26865

@saccarosium saccarosium added bug issues reporting wrong behavior vim vim specific issues labels Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior vim vim specific issues
Projects
None yet
Development

No branches or pull requests

1 participant