mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(api/buffer): fix handling of viewport of non-current buffer
A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
This commit is contained in:
@@ -13,15 +13,19 @@ describe('ffi.cdef', function()
|
||||
|
||||
eq(
|
||||
12,
|
||||
exec_lua [[
|
||||
exec_lua [=[
|
||||
local ffi = require('ffi')
|
||||
|
||||
ffi.cdef('int curwin_col_off(void);')
|
||||
ffi.cdef [[
|
||||
typedef struct window_S win_T;
|
||||
int win_col_off(win_T *wp);
|
||||
extern win_T *curwin;
|
||||
]]
|
||||
|
||||
vim.cmd('set number numberwidth=4 signcolumn=yes:4')
|
||||
|
||||
return ffi.C.curwin_col_off()
|
||||
]]
|
||||
return ffi.C.win_col_off(ffi.C.curwin)
|
||||
]=]
|
||||
)
|
||||
|
||||
eq(
|
||||
@@ -30,7 +34,6 @@ describe('ffi.cdef', function()
|
||||
local ffi = require('ffi')
|
||||
|
||||
ffi.cdef[[
|
||||
typedef struct window_S win_T;
|
||||
typedef struct {} stl_hlrec_t;
|
||||
typedef struct {} StlClickRecord;
|
||||
typedef struct {} statuscol_T;
|
||||
|
||||
Reference in New Issue
Block a user