From 08f10266e3abfd0edeb84c79a48cf50e5598b75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Mon, 3 May 2021 23:34:16 +0200 Subject: [PATCH] fix vim plugin empty mbox message (#136) --- CHANGELOG.md | 2 ++ vim/autoload/himalaya/msg.vim | 2 +- vim/autoload/himalaya/shared/cli.vim | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 421ce5f..c75df67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Table with subject containing `\r` or `\n`[#141] - Overflow panic when shrink column [#138] +- Vim plugin empty mailbox message [#136] ## [0.3.0] - 2021-04-28 @@ -230,5 +231,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#131]: https://github.com/soywod/himalaya/issues/131 [#132]: https://github.com/soywod/himalaya/issues/132 [#133]: https://github.com/soywod/himalaya/issues/133 +[#136]: https://github.com/soywod/himalaya/issues/136 [#138]: https://github.com/soywod/himalaya/issues/138 [#141]: https://github.com/soywod/himalaya/issues/141 diff --git a/vim/autoload/himalaya/msg.vim b/vim/autoload/himalaya/msg.vim index 793178f..2167d9e 100644 --- a/vim/autoload/himalaya/msg.vim +++ b/vim/autoload/himalaya/msg.vim @@ -38,7 +38,7 @@ function! himalaya#msg#list() try let mbox = himalaya#mbox#curr_mbox() let page = himalaya#mbox#curr_page() - call himalaya#msg#list_with(mbox, page, 0) + call himalaya#msg#list_with(mbox, page, 1) catch if !empty(v:exception) redraw | call himalaya#shared#log#err(v:exception) diff --git a/vim/autoload/himalaya/shared/cli.vim b/vim/autoload/himalaya/shared/cli.vim index 8681bd2..92a42df 100644 --- a/vim/autoload/himalaya/shared/cli.vim +++ b/vim/autoload/himalaya/shared/cli.vim @@ -11,12 +11,12 @@ function! himalaya#shared#cli#call(cmd, args, log, should_throw) redraw | call himalaya#shared#log#info(printf("%s [OK]", a:log)) return res.response catch - redraw | call himalaya#shared#log#info(printf("%s [ERR]", a:log)) + redraw for line in split(res, "\n") call himalaya#shared#log#err(line) endfor if a:should_throw - throw res + throw "" endif endtry endif