Files
nixcfg/lua/astronvim/utils/ffi.lua
Daniel Patterson 4132b0ea05 Squashed 'users/configs/system/nvim/nvim/' content from commit e088bce2
git-subtree-dir: users/configs/system/nvim/nvim
git-subtree-split: e088bce2bd90c0b5c35d13a8615a55455b96294d
2023-06-25 15:39:58 +01:00

21 lines
613 B
Lua

-- ### AstroNvim C Extensions
local ffi = require "ffi"
-- Custom C extension to get direct fold information from Neovim
ffi.cdef [[
typedef struct {} Error;
typedef struct {} win_T;
typedef struct {
int start; // line number where deepest fold starts
int level; // fold level, when zero other fields are N/A
int llevel; // lowest level that starts in v:lnum
int lines; // number of lines from v:lnum to end of closed fold
} foldinfo_T;
foldinfo_T fold_info(win_T* wp, int lnum);
win_T *find_window_by_handle(int Window, Error *err);
int compute_foldcolumn(win_T *wp, int col);
]]
return ffi