Skip to content

Commit

Permalink
refactor: Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kylechui committed Nov 25, 2024
1 parent dca2e99 commit 570298e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/nvim-surround/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ M.change = {}
---@param func_name string A string representing the callback function's name.
M.set_callback = function(func_name)
vim.go.operatorfunc = "v:lua.require'nvim-surround.utils'.NOOP"
vim.cmd.normal({ "g@l", bang = true })
vim.cmd.normal({ [1] = "g@l", bang = true })
vim.go.operatorfunc = func_name
end

Expand Down
3 changes: 1 addition & 2 deletions lua/nvim-surround/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,7 @@ M.translate_opts = function(user_opts)
local input = require("nvim-surround.input")
local opts = {}
for key, value in pairs(user_opts) do
if key == "surrounds" then
elseif key == "indent_lines" then
if key == "indent_lines" then
opts[key] = value or function() end
else
opts[key] = value
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-surround/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ M.normal_surround = function(args)
-- Call the operatorfunc if it has not been called yet
if not args.selection then
-- Clear the normal cache (since it was user-called)
cache.normal = { line_mode = args.line_mode }
cache.normal = { delimiters = nil, line_mode = args.line_mode }
M.normal_curpos = buffer.get_curpos()
M.pending_surround = true

Expand Down

0 comments on commit 570298e

Please sign in to comment.