Comments (11)
In particular, provide min.lua
and test.file
so we can run nvim --clean -u min.lua test.file
and reproduce the issue (if necessary, with add debug output).
from neovim.
I've bisected it to 0081549 which was part of #24824.
cc @bfredl
from neovim.
The instructions above do not uniquely identify a situation. I could easily expand that script myself into some complete reproduction script, but so in multiple different ways. Depending on the missing details, the current behavior might or might not actually be the desired one (a change from 0.9.5 is not enough to identify a regression).
from neovim.
Trivially: OTHER_BUFFER_ID
is not defined. and it is not clear at all what that should refer to in your step 2 and 4 respectively.
It is better to just provide a complete script directly, instead of having us guess stuff, to avoid any misunderstanding.
from neovim.
Here is the code to reproduce it... the buffer with the content is scrolled to top after setting lines. When you focus it again, the expected scroll position is restored.
local lines = {}
for i = 1, 100 do
lines[i] = tostring(i)
end
vim.cmd(":new")
local newBuf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_lines(newBuf, 0, -1, false, lines)
vim.cmd(":50")
vim.cmd("vnew")
vim.api.nvim_buf_set_lines(newBuf, 0, -1, false, lines)
from neovim.
Workaround:
for i, line in ipairs(lines) do
vim.api.nvim_buf_set_lines(M.bufnr, i - 1, i, false, { line })
end
from neovim.
@bfredl you didn't provide information on what is exactly missing. Reproduction steps have been provided and the video showing the situation is provided, plus you got the specific commit that changes this behavior. I think you have everything you need :).
from neovim.
@bfredl Could you please take a moment to review this issue as well? Here is the link: #27720
Although my issue may not be identical to the one described here, there is a possibility that they share the same root cause.
I have also included steps to reproduce the issue.
from neovim.
Thanks, it's clear now.
I cannot reproduce however on master ( 633bf61) with nvim --clean -u path/to/script.lua
. Although the behavior you describe sounds like it could happen (for the same reasons as in #27720 (comment) ), am I missing something more?
from neovim.
Maybe it's a matter of timing.
When I call :luafile path/to/script.lua
after nvim --clean -u path/to/script.lua
it's reproducible.
from neovim.
Another related issue: #25370
from neovim.
Related Issues (20)
- netrw "-" go up dir not working HOT 2
- LSP: Support for typescript / typescript-language-server's "Go to Source Definition" command HOT 5
- LSP: user can easily discover, define client commands HOT 11
- Crash "nvim: /home/runner/work/neovim/neovim/src/nvim/message.c:2392: msg_scroll_flush: Assertion `to_scroll >= 0' failed." HOT 9
- popup windows should have URI for lsp extensions HOT 1
- cursorcolumn drastically slows down scrolling HOT 3
- Bicep omnifunc completion mismatch between popup menu and inserted selection HOT 3
- node.js :checkhealth code has runtime error HOT 2
- `vim.base64.decode()` return value is truncated HOT 1
- configdir does not take into account HOME env HOT 1
- Loss of Arbitrary Functions in Autocommands After Upgrading to Neovim nightly (v0.10.0-dev-2830) HOT 1
- Python Tree-sitter @spell highlights string prefixes HOT 5
- custom lint rules for Lua code HOT 2
- Lightweight enhancements to documentation syntax HOT 14
- The help docs do not work correctly with vimdoc TS parser installed HOT 5
- Fixing `'shell'` on Windows, properly HOT 12
- LSP: hook into all inbound and outbound requests HOT 3
- Default colorscheme incorrect HOT 10
- ts_parser__handle_error HOT 2
- Neovim crash almost instantly on MacOS (SEGFAULT) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim.