Skip to content

Commit a1b9577

Browse files
committed
refactor: Rename betterGmatch -> gmatch
1 parent e856877 commit a1b9577

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lua/mkdnflow/links.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ M.createLink = function(args)
865865
-- is, perform the search until a match is found whose right edge follows
866866
-- the cursor position
867867
if cursor_word ~= '' then
868-
for _left, _right in utils.betterGmatch(line, cursor_word) do
868+
for _left, _right in utils.gmatch(line, cursor_word) do
869869
if _right >= col then
870870
left = _left
871871
right = _right

lua/mkdnflow/tables.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ local which_cell = function(row, col)
335335
local cursorline = vim.api.nvim_buf_get_lines(0, row - 1, row, false)[1]
336336
cursorline = cursorline:gsub('\\|', '##')
337337
local init, cell, cursor_cell = 1, 1, nil
338-
for start, finish in utils.betterGmatch(cursorline, '[^|]+') do
338+
for start, finish in utils.gmatch(cursorline, '[^|]+') do
339339
-- Find the indices of the match
340340
if col + 1 >= start and col <= finish then
341341
cursor_cell = cell
@@ -352,7 +352,7 @@ local locate_cell = function(table_row, target_cellnr, locate_cell_contents)
352352
local start, finish
353353
-- Internally replace any escaped bars
354354
table_row = table_row:gsub('\\|', ' ')
355-
for match_start, match_end, match in utils.betterGmatch(table_row, '([^|]+)') do
355+
for match_start, match_end, match in utils.gmatch(table_row, '([^|]+)') do
356356
cur_cell = cur_cell + 1
357357
--start, finish = string.find(table_row, match, init, true)
358358
if cur_cell == target_cellnr then

lua/mkdnflow/utils.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ M.spairs = function(tbl)
258258
end
259259
end
260260

261-
M.betterGmatch = function(text, pattern, start)
261+
M.gmatch = function(text, pattern, start)
262262
start = start ~= nil and start or 1
263263
return function()
264264
if not text then

0 commit comments

Comments
 (0)