mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
dart persist + picker
This commit is contained in:
parent
9457c7436e
commit
4b7636090f
13 changed files with 149 additions and 519 deletions
|
|
@ -9,18 +9,18 @@ M.get_id = function()
|
|||
end
|
||||
|
||||
local result = vim
|
||||
.system({
|
||||
'jj',
|
||||
'log',
|
||||
'-r',
|
||||
'latest(heads(::@ & bookmarks()))',
|
||||
'--template',
|
||||
'bookmarks',
|
||||
'--no-pager',
|
||||
'--no-graph',
|
||||
})
|
||||
:wait()
|
||||
local branch = vim.trim(string.gsub(result.stdout, '[\n*]', '')) -- trim newlines and unpushed indicator
|
||||
.system({
|
||||
'jj',
|
||||
'log',
|
||||
'-r',
|
||||
'latest(heads(::@ & bookmarks()))',
|
||||
'--template',
|
||||
'bookmarks',
|
||||
'--no-pager',
|
||||
'--no-graph',
|
||||
})
|
||||
:wait()
|
||||
local branch = vim.trim(string.gsub(result.stdout, '[\n*]', '')) -- trim newlines and unpushed indicator
|
||||
local root = vim.trim(string.gsub(jj_root.stdout, '\n', ''))
|
||||
local id = string.gsub(string.format('jj:%s:%s', root, branch), '[./]', '-') -- slugify
|
||||
return id
|
||||
|
|
@ -49,12 +49,10 @@ M.load = function()
|
|||
if c == 'Yes' then
|
||||
-- load session (buffers, etc) as well as shada (marks)
|
||||
sessions.read(id)
|
||||
vim.cmd('rshada')
|
||||
vim.notify('loaded jj session: ' .. id)
|
||||
end
|
||||
end)
|
||||
else
|
||||
vim.cmd('wshada') -- create session if it did not exist
|
||||
sessions.write(id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue