aboutsummaryrefslogtreecommitdiff
path: root/lua/extregs/buffer.lua
blob: de7c1afecfccc555f1cac4cda8a52659532c5791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
local M = {}
function M.get_provider(_)
  return {
    read = function()
      return { lines = vim.api.nvim_buf_get_lines(0, 0, -1, false), type = 'V' }
    end,
    write = function(_, reg)
      vim.api.nvim_buf_set_lines(0, 0, -1, false, reg.lines)
      return true
    end,
  }
end
return M