Compare commits

..

1 Commits

Author SHA1 Message Date
7e9e344e8c experimental: renderer
All checks were successful
NeoVim tests / plenary-tests (push) Successful in 11s
2025-03-19 19:16:04 -06:00
3 changed files with 4 additions and 4 deletions

View File

@ -64,7 +64,7 @@ function State:track_mark(mark) self.marks[mark] = vim.api.nvim_buf_get_mark(sel
function State:track_pos(pos) self.positions[pos] = vim.fn.getpos(pos) end function State:track_pos(pos) self.positions[pos] = vim.fn.getpos(pos) end
---@param nm string ---@param nm string
function State:track_global_option(nm) self.global_options[nm] = vim.go[nm] end function State:track_global_option(nm) self.global_options[nm] = vim.g[nm] end
function State:track_winview() self.win_view = vim.fn.winsaveview() end function State:track_winview() self.win_view = vim.fn.winsaveview() end
@ -82,7 +82,7 @@ function State:restore()
vim.keymap.set(map.mode, map.lhs, map.rhs, { buffer = map.buffer }) vim.keymap.set(map.mode, map.lhs, map.rhs, { buffer = map.buffer })
end end
for nm, val in pairs(self.global_options) do for nm, val in pairs(self.global_options) do
vim.go[nm] = val vim.g[nm] = val
end end
if self.win_view ~= nil then vim.fn.winrestview(self.win_view) end if self.win_view ~= nil then vim.fn.winrestview(self.win_view) end
end end

View File

@ -88,7 +88,7 @@ function M.define_text_object(key_seq, fn, opts)
local p = range_or_pos --[[@as Pos]] local p = range_or_pos --[[@as Pos]]
State.run(0, function(s) State.run(0, function(s)
s:track_global_option 'eventignore' s:track_global_option 'eventignore'
vim.go.eventignore = 'all' vim.opt_global.eventignore = 'all'
-- insert a single space, so we can select it: -- insert a single space, so we can select it:
vim.api.nvim_buf_set_text(0, p.lnum, p.col, p.lnum, p.col, { ' ' }) vim.api.nvim_buf_set_text(0, p.lnum, p.col, p.lnum, p.col, { ' ' })

View File

@ -1,5 +1,5 @@
local function withbuf(lines, f) local function withbuf(lines, f)
vim.go.swapfile = false vim.opt_global.swapfile = false
vim.cmd.new() vim.cmd.new()
vim.api.nvim_buf_set_lines(0, 0, -1, false, lines) vim.api.nvim_buf_set_lines(0, 0, -1, false, lines)