aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/ffi_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-03-11 13:19:49 +0100
committerbfredl <bjorn.linse@gmail.com>2024-03-13 07:19:59 +0100
commit08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9 (patch)
tree73da66dcd1ba85b22d88b547b58f920039b167ad /test/functional/lua/ffi_spec.lua
parentd5488633f68fcfd58b4bcad654ab103b4746204b (diff)
downloadrneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.tar.gz
rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.tar.bz2
rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.zip
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
Diffstat (limited to 'test/functional/lua/ffi_spec.lua')
-rw-r--r--test/functional/lua/ffi_spec.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/functional/lua/ffi_spec.lua b/test/functional/lua/ffi_spec.lua
index c9e8e9d4ca..4229e4af9b 100644
--- a/test/functional/lua/ffi_spec.lua
+++ b/test/functional/lua/ffi_spec.lua
@@ -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;