Skip to content

Commit

Permalink
Merge branch 'unstable' of github.com:nvim-neorg/neorg into unstable
Browse files Browse the repository at this point in the history
Former-commit-id: 30ce208
  • Loading branch information
vhyrro committed Oct 24, 2021
2 parents bed1754 + c3b851f commit f56c27b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/neorg/modules/core/gtd/ui/displayers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ module.public = {
module.private.generate_display(name, positions, res)
end,

--- Get the corresponding task from the buffer variable in the current line
--- @return table the task node
get_task_by_var = function()
-- Get the current task at cursor
local current_line = vim.api.nvim_win_get_cursor(0)[1]
Expand Down Expand Up @@ -583,6 +585,10 @@ module.private = {
end
end,

--- Create the buffer and attach options to it
--- @param name string the buffer name
--- @param vars table the variables to add in the buffer
--- @param res table the lines to add
generate_display = function(name, vars, res)
local buf = module.required["core.ui"].create_norg_buffer(name, "vsplitr", nil, false)
module.required["core.mode"].set_mode("gtd-displays")
Expand All @@ -594,6 +600,10 @@ module.private = {
vim.api.nvim_buf_set_option(buf, "modifiable", false)
end,

--- Update created variables inside the buffer (will offset the variables depending of the lines_inserted)
--- @param lines_inserted table the lines inserted
--- @param line number the position of the line we inserted the values from
--- @param remove boolean|nil if true, will offset the variables negatively
update_vars = function(lines_inserted, line, remove)
local lines = vim.api.nvim_buf_line_count(module.private.current_bufnr)
local updated_vars = {}
Expand Down
4 changes: 4 additions & 0 deletions lua/neorg/modules/core/keybinds/default_keybinds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ module.public = {
{ "e", "core.gtd.ui.edit_task" },
{ "d", "core.gtd.ui.details" },
},
}, {
silent = true,
noremap = true,
nowait = true,
})

-- Apply the below keys to all modes
Expand Down

0 comments on commit f56c27b

Please sign in to comment.