Skip to content

Commit 7c28610

Browse files
committed
style: Format
1 parent 05d5693 commit 7c28610

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

lua/mkdnflow/cursor.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ local go_to_heading = function(anchor_text, reverse)
153153
-- If the line has contents, do the thing
154154
if line[1] then
155155
-- Are we in a code block?
156-
if string.find(line[1], "^```") then
156+
if string.find(line[1], '^```') then
157157
-- Flip the truth value
158158
in_fenced_code_block = not in_fenced_code_block
159159
end

lua/mkdnflow/folds.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ local get_section_range = function(start_row)
3737
while continue do
3838
local next_line = vim.api.nvim_buf_get_lines(0, end_row - 1, end_row, false)
3939
if next_line[1] then
40-
if string.find(next_line[1], "^```") then
40+
if string.find(next_line[1], '^```') then
4141
-- Flip the truth value
4242
in_fenced_code_block = not in_fenced_code_block
4343
end
44-
if M.getHeadingLevel(next_line[1]) <= heading_level and not in_fenced_code_block then
44+
if
45+
M.getHeadingLevel(next_line[1]) <= heading_level and not in_fenced_code_block
46+
then
4547
continue = false
4648
else
4749
end_row = end_row + 1
@@ -61,7 +63,7 @@ local get_nearest_heading = function()
6163
local continue, in_fenced_code_block = true, utils.cursorInCodeBlock(row)
6264
while continue and row > 0 do
6365
local prev_line = vim.api.nvim_buf_get_lines(0, row - 1, row, false)[1]
64-
if string.find(prev_line, "^```") then
66+
if string.find(prev_line, '^```') then
6567
-- Flip the truth value
6668
in_fenced_code_block = not in_fenced_code_block
6769
end

lua/mkdnflow/utils.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,11 @@ M.cursorInCodeBlock = function(cursor_row, reverse)
283283
else
284284
reverse = true
285285
end
286-
local lines = reverse and vim.api.nvim_buf_get_lines(0, cursor_row - 1, -1, false) or vim.api.nvim_buf_get_lines(0, 0, cursor_row, false)
286+
local lines = reverse and vim.api.nvim_buf_get_lines(0, cursor_row - 1, -1, false)
287+
or vim.api.nvim_buf_get_lines(0, 0, cursor_row, false)
287288
local fences = 0
288289
for _, line_text in ipairs(lines) do
289-
local _, count = string.gsub(line_text, "^```", "```")
290+
local _, count = string.gsub(line_text, '^```', '```')
290291
fences = fences + count
291292
end
292293
if fences % 2 == 0 then

0 commit comments

Comments
 (0)