From 19e8bf39e815f52dc81d3240d89d80ad220009d0 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Fri, 7 Jul 2023 15:33:31 +0200 Subject: [PATCH] applying stylua --- lua/neorg/config.lua | 6 ++--- .../modules/core/esupports/metagen/module.lua | 22 ++++++++++++++----- lua/neorg/modules/core/tangle/module.lua | 10 ++++----- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lua/neorg/config.lua b/lua/neorg/config.lua index 47f3aa227f..de3d053c31 100644 --- a/lua/neorg/config.lua +++ b/lua/neorg/config.lua @@ -68,11 +68,11 @@ neorg.configuration.os_info = (function() elseif os == "darwin" then return "mac" elseif os == "linux" then - local f = io.open('/proc/version', 'r') + local f = io.open("/proc/version", "r") if f ~= nil then - local version = f:read('*all') + local version = f:read("*all") f:close() - if version:find('microsoft') then + if version:find("microsoft") then return "wsl" end end diff --git a/lua/neorg/modules/core/esupports/metagen/module.lua b/lua/neorg/modules/core/esupports/metagen/module.lua index 4794158683..4bf69a14cf 100644 --- a/lua/neorg/modules/core/esupports/metagen/module.lua +++ b/lua/neorg/modules/core/esupports/metagen/module.lua @@ -41,16 +41,20 @@ module.config.public = { -- The title field generates a title for the file based on the filename. { "title", - function() return vim.fn.expand("%:p:t:r") end, + function() + return vim.fn.expand("%:p:t:r") + end, }, -- The description field is always kept empty for the user to fill in. { "description", "" }, -- The authors field is autopopulated by querying the current user's system username. - { + { "authors", - function() return require("neorg.external.helpers").get_username() end, + function() + return require("neorg.external.helpers").get_username() + end, }, -- The categories field is always kept empty for the user to fill in. @@ -59,21 +63,27 @@ module.config.public = { -- The created field is populated with the current date as returned by `os.date`. { "created", - function() return os.date("%Y-%m-%d") end, + function() + return os.date("%Y-%m-%d") + end, }, -- When creating fresh, new metadata, the updated field is populated the same way -- as the `created` date. { "updated", - function() return os.date("%Y-%m-%d") end, + function() + return os.date("%Y-%m-%d") + end, }, -- The version field determines which Norg version was used when -- the file was created. { "version", - function() return require("neorg.config").norg_version end + function() + return require("neorg.config").norg_version + end, }, }, } diff --git a/lua/neorg/modules/core/tangle/module.lua b/lua/neorg/modules/core/tangle/module.lua index 7f212eeb9b..8be972e0a5 100644 --- a/lua/neorg/modules/core/tangle/module.lua +++ b/lua/neorg/modules/core/tangle/module.lua @@ -279,7 +279,6 @@ module.public = { end if file_to_tangle_to then - -- get current heading local heading_string local heading = module.required["core.integrations.treesitter"].find_parent(node, "heading%d+") @@ -290,7 +289,6 @@ module.public = { -- don't reuse the same header more than once if heading_string and previous_headings[language] ~= heading then - -- Get commentstring from vim scratch buffer if not commentstrings[language] then local cur_buf = vim.api.nvim_get_current_buf() @@ -299,13 +297,13 @@ module.public = { vim.bo.filetype = language commentstrings[language] = vim.bo.commentstring vim.api.nvim_set_current_buf(cur_buf) - vim.api.nvim_buf_delete(tmp_buf, {force = true}) + vim.api.nvim_buf_delete(tmp_buf, { force = true }) end if commentstrings[language] ~= "" then - table.insert(content, 1, "") - table.insert(content, 1, commentstrings[language]:format(heading_string)) - previous_headings[language] = heading + table.insert(content, 1, "") + table.insert(content, 1, commentstrings[language]:format(heading_string)) + previous_headings[language] = heading end end