Skip to content

Commit 34b9261

Browse files
Format according to latest Stylua version
1 parent f161b3a commit 34b9261

File tree

6 files changed

+13
-31
lines changed

6 files changed

+13
-31
lines changed

lua/orgmode/agenda/init.lua

+2-6
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,8 @@ function Agenda:_remote_edit(opts)
414414
end
415415
if item.agenda_item then
416416
item.agenda_item:set_headline(headline)
417-
self.content[line] = AgendaView.build_agenda_item_content(
418-
item.agenda_item,
419-
item.longest_category,
420-
item.longest_date,
421-
item.line
422-
)
417+
self.content[line] =
418+
AgendaView.build_agenda_item_content(item.agenda_item, item.longest_category, item.longest_date, item.line)
423419
else
424420
self.content[line] = AgendaTodosView.generate_todo_item(headline, item.longest_category, item.line)
425421
end

lua/orgmode/objects/edit_special/types/src.lua

+2-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ function EditSpecialSrc:_update_content(action, block_start_line, content)
2929
-- will have its column reported as 0)
3030
--
3131
-- Grab the line itself in order to circumvent this
32-
local block_start_line_text = vim.api.nvim_buf_get_lines(
33-
self.org_bufnr,
34-
block_start_line,
35-
block_start_line + 1,
36-
false
37-
)[1]
32+
local block_start_line_text =
33+
vim.api.nvim_buf_get_lines(self.org_bufnr, block_start_line, block_start_line + 1, false)[1]
3834

3935
-- Not quite what Emacs does, but assume that the leading space of the entire block is consistent
4036
-- and strip that off

lua/orgmode/org/mappings.lua

+2-6
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,8 @@ function OrgMappings:_todo_change_state(direction)
399399
end
400400

401401
self:_change_todo_state('reset')
402-
local state_change = string.format(
403-
'- State "%s" from "%s" [%s]',
404-
item.todo_keyword.value,
405-
old_state,
406-
Date.now():to_string()
407-
)
402+
local state_change =
403+
string.format('- State "%s" from "%s" [%s]', item.todo_keyword.value, old_state, Date.now():to_string())
408404

409405
local data = item:add_properties({ LAST_REPEAT = '[' .. Date.now():to_string() .. ']' })
410406
if data.is_new then

lua/orgmode/parser/file.lua

+4-6
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,8 @@ function File:get_closest_headline(id)
279279
node = self:get_node_at_cursor()
280280
else
281281
local cursor_range = { id - 1, vim.fn.col('$') - 2 }
282-
node = self.tree
283-
:root()
284-
:named_descendant_for_range(cursor_range[1], cursor_range[2], cursor_range[1], cursor_range[2])
282+
node =
283+
self.tree:root():named_descendant_for_range(cursor_range[1], cursor_range[2], cursor_range[1], cursor_range[2])
285284
end
286285

287286
if not node then
@@ -374,9 +373,8 @@ end
374373

375374
---@private
376375
function File:_parse_source_code_filetypes()
377-
local blocks = self:get_ts_matches(
378-
'(block name: (expr) @name parameter: (expr) @parameters (#match? @name "(src|SRC)"))'
379-
)
376+
local blocks =
377+
self:get_ts_matches('(block name: (expr) @name parameter: (expr) @parameters (#match? @name "(src|SRC)"))')
380378
local source_code_filetypes = {}
381379
for _, item in ipairs(blocks) do
382380
local ft = item.parameters and item.parameters.text

lua/orgmode/parser/section.lua

+2-6
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,8 @@ function Section:_update_date(date, new_date)
612612
})
613613
local line = vim.api.nvim_call_function('getline', { date.range.start_line })
614614
local view = vim.fn.winsaveview()
615-
local new_line = string.format(
616-
'%s%s%s',
617-
line:sub(1, date.range.start_col),
618-
date:to_string(),
619-
line:sub(date.range.end_col)
620-
)
615+
local new_line =
616+
string.format('%s%s%s', line:sub(1, date.range.start_col), date:to_string(), line:sub(date.range.end_col))
621617
vim.api.nvim_call_function('setline', {
622618
date.range.start_line,
623619
new_line,

stylua.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2
55
quote_style = "AutoPreferSingle"
6-
no_call_parentheses = false
6+
call_parentheses = "Always"

0 commit comments

Comments
 (0)