Skip to content

Commit 284400a

Browse files
committed
Rename variable 'string' to 'str'
1 parent ee7ffc1 commit 284400a

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

lua/scrollview.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,8 +2093,8 @@ local read_input_stream = function()
20932093
break
20942094
end
20952095
end
2096-
local string = table.concat(chars, '')
2097-
local result = {string, chars_props}
2096+
local str = table.concat(chars, '')
2097+
local result = {str, chars_props}
20982098
return unpack(result)
20992099
end
21002100

@@ -2829,7 +2829,7 @@ local handle_mouse = function(button, primary)
28292829
local scrollbar_offset
28302830
local previous_row
28312831
local idx = 1
2832-
local string, chars_props = '', {}
2832+
local str, chars_props = '', {}
28332833
local str_idx, char, mouse_winid, mouse_row, mouse_col
28342834
local props
28352835
-- Computing this prior to the first mouse event could distort the location
@@ -2844,7 +2844,7 @@ local handle_mouse = function(button, primary)
28442844
idx = idx + 1
28452845
if idx > #chars_props then
28462846
idx = 1
2847-
string, chars_props = read_input_stream()
2847+
str, chars_props = read_input_stream()
28482848
end
28492849
local char_props = chars_props[idx]
28502850
str_idx = char_props.str_idx
@@ -2866,7 +2866,7 @@ local handle_mouse = function(button, primary)
28662866
end
28672867
end
28682868
if char == t'<esc>' then
2869-
fn.feedkeys(string.sub(string, str_idx + #char), 'ni')
2869+
fn.feedkeys(string.sub(str, str_idx + #char), 'ni')
28702870
return
28712871
end
28722872
-- In select-mode, mouse usage results in the mode intermediately
@@ -2882,18 +2882,18 @@ local handle_mouse = function(button, primary)
28822882
if char ~= '\x80\xf5X' or count == 0 then
28832883
if mouse_winid == 0 then
28842884
-- There was no mouse event.
2885-
fn.feedkeys(string.sub(string, str_idx), 'ni')
2885+
fn.feedkeys(string.sub(str, str_idx), 'ni')
28862886
return
28872887
end
28882888
if char == mouseup then
28892889
if count == 0 then
28902890
-- No initial mousedown was captured.
2891-
fn.feedkeys(string.sub(string, str_idx), 'ni')
2891+
fn.feedkeys(string.sub(str, str_idx), 'ni')
28922892
elseif count == 1 then
28932893
-- A scrollbar was clicked, but there was no corresponding drag.
28942894
-- Allow the interaction to be processed as it would be with no
28952895
-- scrollbar.
2896-
fn.feedkeys(mousedown .. string.sub(string, str_idx), 'ni')
2896+
fn.feedkeys(mousedown .. string.sub(str, str_idx), 'ni')
28972897
else
28982898
-- A scrollbar was clicked and there was a corresponding drag.
28992899
-- 'feedkeys' is not called, since the full mouse interaction has
@@ -2913,7 +2913,7 @@ local handle_mouse = function(button, primary)
29132913
if count == 0 then
29142914
if mouse_winid < 0 then
29152915
-- The mouse event was on the tabline or command line.
2916-
fn.feedkeys(string.sub(string, str_idx), 'ni')
2916+
fn.feedkeys(string.sub(str, str_idx), 'ni')
29172917
return
29182918
end
29192919
props = get_scrollview_bar_props(mouse_winid)
@@ -2941,7 +2941,7 @@ local handle_mouse = function(button, primary)
29412941
if not clicked_bar and not clicked_sign then
29422942
-- There was either no scrollbar or signs in the window where a
29432943
-- click occurred or the click was not on a scrollbar or sign.
2944-
fn.feedkeys(string.sub(string, str_idx), 'ni')
2944+
fn.feedkeys(string.sub(str, str_idx), 'ni')
29452945
return
29462946
end
29472947
if clicked_sign and primary then

lua/scrollview/signs/conflicts.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ function M.init(enable)
7070
local line_count = api.nvim_buf_line_count(bufnr)
7171
for line = 1, line_count do
7272
local match = false
73-
local string = fn.getbufline(bufnr, line)[1]
73+
local str = fn.getbufline(bufnr, line)[1]
7474
if position == TOP then
75-
match = vim.startswith(string, '<<<<<<< ')
75+
match = vim.startswith(str, '<<<<<<< ')
7676
elseif position == MIDDLE then
77-
match = string == '======='
77+
match = str == '======='
7878
elseif position == BOTTOM then
79-
match = vim.startswith(string, '>>>>>>> ')
79+
match = vim.startswith(str, '>>>>>>> ')
8080
else
8181
error('Unknown position: ' .. position)
8282
end

lua/scrollview/signs/textwidth.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ function M.init(enable)
4545
if textwidth > 0 then
4646
api.nvim_win_call(winid, function()
4747
for line = 1, line_count do
48-
local string = fn.getbufline(bufnr, line)[1]
49-
local line_length = fn.strchars(string, 1)
48+
local str = fn.getbufline(bufnr, line)[1]
49+
local line_length = fn.strchars(str, 1)
5050
if line_length > textwidth then
5151
table.insert(lines, line)
5252
end

lua/scrollview/signs/trail.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ function M.init(enable)
4242
else
4343
local line_count = api.nvim_buf_line_count(bufnr)
4444
for line = 1, line_count do
45-
local string = fn.getbufline(bufnr, line)[1]
46-
if string.match(string, "%s$") then
45+
local str = fn.getbufline(bufnr, line)[1]
46+
if string.match(str, "%s$") then
4747
table.insert(lines, line)
4848
end
4949
end

0 commit comments

Comments
 (0)