Skip to content

notomo/obhook.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

obhook.nvim

WIP

This provides hooks for table access/function call. Mainly use is a helper investigating neovim bug.

Example

local obhook = require("obhook")
local hooked_vim = obhook.new(vim, {
  hooks = {
    before_newindex = function(ctx, tbl, k, v)
      local str = obhook.string_newindex(ctx, tbl, k, v)
      vim.print(str) -- vim["opt"]["wrap"] = false
    end,
    before_call = function(ctx, f, args)
      local str = obhook.string_call(ctx, f, args)
      vim.print(str) -- vim["api"]["nvim_create_buf"](false, true)
    end,
  },
  parent_keys = { "vim" },
})

local vim = hooked_vim
vim.opt.wrap = false
vim.api.nvim_create_buf(false, true)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published