Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ftplugin/mail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ if vim.startswith(vim.fs.basename(vim.api.nvim_buf_get_name(0)), "thread:") then
vim.opt_local.foldmethod = "marker"
vim.opt_local.foldlevel = 0

-- if there is only one message, open it
if vim.b.notmuch_messages and #vim.b.notmuch_messages == 1 then
vim.schedule(function()
vim.cmd.normal({ args = { "zR" }, bang = true })
end)
end

vim.api.nvim_buf_create_user_command(0, "TagAdd", function(arg)
tag.msg_add_tag(arg.args)
end, {
Expand Down
5 changes: 3 additions & 2 deletions lua/notmuch/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ nm.show_thread = function(s)
v.nvim_buf_set_lines(buf, 0, 0, false, { hint_text, "" })

-- Place cursor at head of buffer and prepare display and disable modification
v.nvim_buf_set_lines(buf, -2, -1, true, {})
v.nvim_win_set_cursor(0, { 1, 0})
v.nvim_buf_set_lines(buf, -2, -1, true, {}) -- remove last line from buffer
v.nvim_win_set_cursor(0, { 4, 0 }) -- jump to first thread
-- set buffer options
vim.bo.filetype="mail"
vim.bo.modifiable = false

Expand Down
Loading