jakewvincent / mkdnflow.nvim

Fluent navigation and management of markdown notebooks
GNU General Public License v3.0
689 stars 41 forks source link

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

Open bugsbugsbux opened 2 years ago

bugsbugsbux commented 2 years ago

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
jakewvincent commented 2 years ago

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.

bugsbugsbux commented 2 years ago

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?

jakewvincent commented 2 years ago

Oh, interesting! Yes, I also use Lualine.

jakewvincent commented 2 years ago

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
    }
})