Skip to content

Commit 95d2a3e

Browse files
committed
refactor: Rename functions
1 parent c14ac8d commit 95d2a3e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lua/debugprint/init.lua

+9-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local default_display_counter = function()
1515
end
1616

1717
---@return string
18-
local debuginfo_tag_and_counter = function()
18+
local get_debugline_tag_and_counter = function()
1919
local tag_and_counter = ""
2020

2121
if global_opts.print_tag then
@@ -34,7 +34,7 @@ end
3434

3535
---@param opts DebugprintFunctionOptionsInternal
3636
---@return string
37-
local debuginfo = function(opts)
37+
local get_debugline_textcontent = function(opts)
3838
local current_line_nr = vim.api.nvim_win_get_cursor(0)[1]
3939

4040
local line_components = {}
@@ -49,7 +49,7 @@ local debuginfo = function(opts)
4949
force_snippet_for_plain = true
5050
end
5151

52-
local tag_and_counter = debuginfo_tag_and_counter()
52+
local tag_and_counter = get_debugline_tag_and_counter()
5353

5454
if tag_and_counter ~= "" then
5555
table.insert(line_components, tag_and_counter .. ":")
@@ -115,21 +115,23 @@ local construct_debugprint_line = function(opts, fileconfig)
115115
end
116116

117117
line_to_insert = left
118-
.. debuginfo(opts)
118+
.. get_debugline_textcontent(opts)
119119
.. fileconfig.mid_var
120120
.. opts.variable_name
121121
.. fileconfig.right_var
122122
else
123123
opts.variable_name = nil
124-
line_to_insert = fileconfig.left .. debuginfo(opts) .. fileconfig.right
124+
line_to_insert = fileconfig.left
125+
.. get_debugline_textcontent(opts)
126+
.. fileconfig.right
125127
end
126128

127129
return line_to_insert
128130
end
129131

130132
---@param opts DebugprintFunctionOptionsInternal
131133
---@return nil
132-
local addline = function(opts)
134+
local insert_debugprint_line = function(opts)
133135
local line_to_insert
134136

135137
local fileconfig = get_filetype_config()
@@ -176,7 +178,7 @@ local cache_request = {}
176178

177179
---@return nil
178180
M.debugprint_operatorfunc_regular = function()
179-
addline(cache_request)
181+
insert_debugprint_line(cache_request)
180182
utils_operator.set_callback(
181183
"v:lua.require'debugprint'.debugprint_operatorfunc_regular"
182184
)

0 commit comments

Comments
 (0)