Skip to content

Commit

Permalink
refactor: don't expose all of the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
NStefan002 committed Jan 18, 2025
1 parent 918fc3a commit 86ef657
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/visual-surround/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local Surround = {}

---@param char string
---@return string, string
function Surround._get_char(char)
local function get_char(char)
if char == "(" or char == ")" then
return "(", ")"
elseif char == "[" or char == "]" then
Expand All @@ -18,7 +18,7 @@ function Surround._get_char(char)
return char, char
end

function Surround._set_keymaps()
local function set_keymaps()
local keys = Config.opts.surround_chars
for _, key in ipairs(keys) do
vim.keymap.set("v", key, function()
Expand All @@ -29,7 +29,7 @@ end

---@param char string
function Surround.surround(char)
local opening_char, closing_char = Surround._get_char(char)
local opening_char, closing_char = get_char(char)
local mode = vim.api.nvim_get_mode().mode
local bounds = Util.get_bounds(mode)
if mode == "v" or mode == "V" then
Expand Down Expand Up @@ -85,7 +85,7 @@ end
function Surround.setup(user_opts)
Config.override_config(user_opts)
if Config.opts.use_default_keymaps then
Surround._set_keymaps()
set_keymaps()
end
end

Expand Down

0 comments on commit 86ef657

Please sign in to comment.