Skip to content

Commit

Permalink
applying stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathf committed Jul 7, 2023
1 parent f9d533e commit 19e8bf3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
6 changes: 3 additions & 3 deletions lua/neorg/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 16 additions & 6 deletions lua/neorg/modules/core/esupports/metagen/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
},
},
}
Expand Down
10 changes: 4 additions & 6 deletions lua/neorg/modules/core/tangle/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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+")
Expand All @@ -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()
Expand All @@ -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

Expand Down

0 comments on commit 19e8bf3

Please sign in to comment.