Skip to content

Commit

Permalink
Merge branch 'nvim-neorg:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas authored Mar 26, 2024
2 parents e411294 + 20be50c commit 5dc0157
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 40 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [8.2.0](https://github.com/nvim-neorg/neorg/compare/v8.1.0...v8.2.0) (2024-03-25)


### Features

* **metagen:** add author field to provide persistent custom author name ([#1331](https://github.com/nvim-neorg/neorg/issues/1331)) ([e576308](https://github.com/nvim-neorg/neorg/commit/e576308243b58838ed97309bec60bf180cde3c91))


### Bug Fixes

* **ci:** "could not find upvalue `lib`" error ([486a148](https://github.com/nvim-neorg/neorg/commit/486a148d1bf5b7fd14f52a771a0dacc1e6839174))
* **ci:** supply correct version to the lua setup CI ([c814ef6](https://github.com/nvim-neorg/neorg/commit/c814ef68295baffefed7bfb8a48f8835f73a55a6))
* **core/events:** fall back to the current window ID if it cannot be located ([22df349](https://github.com/nvim-neorg/neorg/commit/22df349df39d9401a95f7dc0e3dc13113f91a60a))
* **dirman:** properly escape directories and filenames ([#1232](https://github.com/nvim-neorg/neorg/issues/1232)) ([e1f5556](https://github.com/nvim-neorg/neorg/commit/e1f5556bfbe50cbae262dffc35f376f7469f68cf))
* do not add the line jump of a link to the jump list ([#1325](https://github.com/nvim-neorg/neorg/issues/1325)) ([918f2a3](https://github.com/nvim-neorg/neorg/commit/918f2a39f96e1447c00871eb611bed2018a047b5))
* **export.markdown:** export `authors` metadata field key as `author` ([#1319](https://github.com/nvim-neorg/neorg/issues/1319)) ([f30ce72](https://github.com/nvim-neorg/neorg/commit/f30ce728e1b99e23320114c3bddb18be2776baf7))
* **export.markdown:** fix incorrect reset of ordered list item count ([#1324](https://github.com/nvim-neorg/neorg/issues/1324)) ([ba58c1b](https://github.com/nvim-neorg/neorg/commit/ba58c1b29c9b013928025db345c6ff170e9693bf))

## [8.1.0](https://github.com/nvim-neorg/neorg/compare/v8.0.1...v8.1.0) (2024-03-24)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ Immense thank you to all of the sponsors of my work!

<div align="center">

<!-- sponsors --><a href="https://github.com/vsedov"><img src="https://github.com/vsedov.png" width="60px" alt="vsedov" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/skbolton"><img src="https://github.com/skbolton.png" width="60px" alt="skbolton" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/molleweide"><img src="https://github.com/molleweide.png" width="60px" alt="molleweide" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/danymat"><img src="https://github.com/danymat.png" width="60px" alt="danymat" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/theherk"><img src="https://github.com/theherk.png" width="60px" alt="theherk" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/purepani"><img src="https://github.com/purepani.png" width="60px" alt="purepani" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/refaelsh"><img src="https://github.com/refaelsh.png" width="60px" alt="refaelsh" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/tromars"><img src="https://github.com/tromars.png" width="60px" alt="tromars" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/jgregoire"><img src="https://github.com/jgregoire.png" width="60px" alt="jgregoire" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/bottd"><img src="https://github.com/bottd.png" width="60px" alt="bottd" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/coltbo"><img src="https://github.com/coltbo.png" width="60px" alt="coltbo" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/DingDean"><img src="https://github.com/DingDean.png" width="60px" alt="DingDean" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/Ladas552"><img src="https://github.com/Ladas552.png" width="60px" alt="Ladas552" /></a>&nbsp;&nbsp;&nbsp;<!-- sponsors -->
<!-- sponsors --><a href="https://github.com/vsedov"><img src="https://github.com/vsedov.png" width="60px" alt="vsedov" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/skbolton"><img src="https://github.com/skbolton.png" width="60px" alt="skbolton" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/molleweide"><img src="https://github.com/molleweide.png" width="60px" alt="molleweide" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/danymat"><img src="https://github.com/danymat.png" width="60px" alt="danymat" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/theherk"><img src="https://github.com/theherk.png" width="60px" alt="theherk" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/purepani"><img src="https://github.com/purepani.png" width="60px" alt="purepani" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/refaelsh"><img src="https://github.com/refaelsh.png" width="60px" alt="refaelsh" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/tromars"><img src="https://github.com/tromars.png" width="60px" alt="tromars" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/jgregoire"><img src="https://github.com/jgregoire.png" width="60px" alt="jgregoire" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/bottd"><img src="https://github.com/bottd.png" width="60px" alt="bottd" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/DingDean"><img src="https://github.com/DingDean.png" width="60px" alt="DingDean" /></a>&nbsp;&nbsp;&nbsp;<a href="https://github.com/Ladas552"><img src="https://github.com/Ladas552.png" width="60px" alt="Ladas552" /></a>&nbsp;&nbsp;&nbsp;<!-- sponsors -->

</div>
2 changes: 1 addition & 1 deletion lua/neorg/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local config = {
arguments = {},

norg_version = "1.1.1",
version = "8.1.0",
version = "8.2.0",

os_info = os_info,
pathsep = os_info == "windows" and "\\" or "/",
Expand Down
26 changes: 23 additions & 3 deletions lua/neorg/modules/core/esupports/metagen/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,29 @@ module.config.public = {
-- - "implicit-local" like "local", but the timezone information is omitted from the timestamp
timezone = "local",

-- Whether or not to call :h :undojoin just before changing the timestamp in `update_metadata`
-- This will make your undo key undo the last change before writing the file in addition to the
-- timestamp change. This will move your cursor to the top of the file.
-- Whether or not to call `:h :undojoin` just before changing the timestamp in
-- `update_metadata`. This will make your undo key undo the last change before writing the file
-- in addition to the timestamp change. This will move your cursor to the top of the file. For
-- users with an autosave plugin, this option must be paired with keybinds for undo/redo to
-- avoid problems with undo tree branching:
-- ```lua
-- ["core.keybinds"] = {
-- config = {
-- hook = function(keybinds)
-- keybinds.map("norg", "n", "u", function()
-- require("neorg.modules.core.esupports.metagen.module").public.skip_next_update()
-- local k = vim.api.nvim_replace_termcodes("u<c-o>", true, false, true)
-- vim.api.nvim_feedkeys(k, 'n', false)
-- end)
-- keybinds.map("norg", "n", "<c-r>", function()
-- require("neorg.modules.core.esupports.metagen.module").public.skip_next_update()
-- local k = vim.api.nvim_replace_termcodes("<c-r><c-o>", true, false, true)
-- vim.api.nvim_feedkeys(k, 'n', false)
-- end)
-- end,
-- },
-- },
-- ```
undojoin_updates = false,
}

Expand Down
60 changes: 26 additions & 34 deletions lua/neorg/modules/core/neorgcmd/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -439,46 +439,38 @@ module.on_event = function(event)
end

if event.type == "core.neorgcmd.events.module.list" then
if not neorg.modules.is_module_loaded("core.ui") then
log.error(":Neorg module list requires the `core.ui` module to be loaded!")
return
end
local Popup = require("nui.popup")

local module_list_popup = Popup({
position = "50%",
size = { width = "50%", height = "80%" },
enter = true,
buf_options = {
filetype = "norg",
modifiable = true,
readonly = false,
},
win_options = {
conceallevel = 3,
concealcursor = "nvi",
},
})

local lines = {
-- modules.get_module_config("core.concealer").icons.heading.level_1.icon
"*"
.. " "
.. "Loaded Neorg Modules",
}
module_list_popup:on("VimResized", function()
module_list_popup:update_layout()
end)

for _, mod in pairs(modules.loaded_modules) do
table.insert(lines, " - `" .. mod.name .. "`")
local lines = {}

for name, _ in pairs(neorg.modules.loaded_modules) do
table.insert(lines, "- `" .. name .. "`")
end

-- FIXME(vhyrro): This creates a listed buffer which makes things very ugly.
-- Also make sure to disable folds in this view.
local buf = neorg.modules.get_module("core.ui").create_norg_buffer("module_list", "nosplit")
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
vim.keymap.set("n", "q", vim.cmd.quit, { buffer = buf, silent = true, nowait = true })

local width = vim.api.nvim_win_get_width(0)
local height = vim.api.nvim_win_get_height(0)

vim.api.nvim_open_win(buf, true, {
relative = "win",
win = 0,
width = math.floor(width * 0.7),
height = math.floor(height * 0.9),
col = math.floor(width * 0.15),
row = math.floor(height * 0.05),
border = "single",
style = "minimal",
})
vim.api.nvim_buf_set_lines(module_list_popup.bufnr, 0, -1, true, lines)

vim.bo[buf].modifiable = false
vim.bo[buf].filetype = "norg"
vim.bo[module_list_popup.bufnr].modifiable = false

vim.api.nvim_buf_set_name(buf, "loaded_modules.norg")
module_list_popup:mount()
end
end

Expand Down
2 changes: 1 addition & 1 deletion lua/neorg/modules/core/ui/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.public = {

local bufname = "neorg://" .. name

if vim.fn.bufexists(bufname) == 1 then
if vim.fn.bufexists(bufname) == 1 then ---@diagnostic disable-line
log.error("Buffer '" .. name .. "' already exists")
return
end
Expand Down

0 comments on commit 5dc0157

Please sign in to comment.