mkdnflow.nvim icon indicating copy to clipboard operation
mkdnflow.nvim copied to clipboard

Bug: Messages echoed to command line are (sometimes) indented

Open bugsbugsbux opened this issue 2 years ago • 4 comments

Behaviour: When i open a markdown file (as in nvim index.md, not when vim is already open) the mkdnflow message is indented:

                    ⬇️  Notebook: wiki

Expected behaviour: I would expect the message to appear unindented as it does when i open a markdown file from within nvim (like :e index.md):

⬇️  Notebook: wiki

:version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

bugsbugsbux avatar Jun 27 '22 18:06 bugsbugsbux

Hi @marcusatiliusregulus, thanks for the issue. I noticed this a while ago as well and am a bit puzzled by the problem. I can't work out if it's a problem with the plugin or with Neovim. As far as I can tell, there's nothing in the plugin that would cause this--there is certainly no leading whitespace in the strings passed to nvim_echo. I've gotten the problem to temporarily go away if I run :PackerCompile (which makes no sense to me). I'll try to look into this more soon but will keep this open to track it.

jakewvincent avatar Jun 27 '22 18:06 jakewvincent

ok, i investigated a bit more and it seems to be a problem with a plugin i installed. i put vim.api.nvim_echo({{'hello world', 'WarningMsg'}}, true, {}) in my vimrc and the output is indented if i put it after loading my plugins and not if i put it before them. if i uninstall lualine the problem goes away. do you have lualine installed, too?

bugsbugsbux avatar Jun 27 '22 19:06 bugsbugsbux

Oh, interesting! Yes, I also use Lualine.

jakewvincent avatar Jun 27 '22 20:06 jakewvincent

Well, I just tried removing Lualine and I'm still getting the indented messages, so I guess that's not it. The odd thing about this is how inconsistent it is--you removed Lualine and it stopped for you but not for me. I sometimes got it to go away by running PackerCompile.

I realized that this stopped happening for me when I started using the new global statusline, but I see that it's coming back when I disable that. So until I can figure out where this is coming from, enabling the global statusline might be an acceptable workaround.

-- Tell nvim to use global statusline
vim.opt.laststatus = 3
-- Tell Lualine we're using global statusline
lualine.setup({
    options = {
        globalstatus = true
    }
})

jakewvincent avatar Jun 30 '22 17:06 jakewvincent