SidOfc / mkdx

A vim plugin that adds some nice extra's for working with markdown documents
https://www.vim.org/scripts/script.php?script_id=5620
MIT License
484 stars 13 forks source link

Suddenly no longer able to enter new line #180

Closed on3iro closed 1 year ago

on3iro commented 1 year ago

OS type:

Vim:

Vim version: 0.8.1

For vim: vim -v For nvim: nvim -v

Reproduce steps:

Example:

  1. Open a markdown file.
  2. Try to press enter in insert mode or 'o' in normal mode

Expected: I am in insert mode on a new line below the current line

Actual:

The text <Plug>(mkdx-enter) is written to the current line.

The behavior suddenly appeared an I can just assume that there has been a very minor change on my system/keyboard, but I can't figure out what it is and really don't know how to debug this. I also tried to rollback to a working config I had months ago, but even then the issue persists. I also used another terminal, restarted my computer and tried an older neovim version, used a minimal init.vim/init.lua with only mkdx, but to no avail. Any idea what could cause this or how I could debug this?

SidOfc commented 1 year ago

Unfortunately I have no idea, I'm not sure if I've ever even encountered the issue, definitely not in recent memory anyways. There are many things you can probably check to close in on the source of the issue, thinking about ideas such as "are all plug mappings broken, or just those of this plugin".

Since I don't think this is related to mkdx at this point in time I am going to close this issue. That said, if you find out more and realize that indeed mkdx is causing the problem please do comment and perhaps we can solve it then, assuming a lot more details will be available about how to reproduce.

Also, to help potential future users who may experience something similar, if you find a solution to this problem, would you mind sharing your solution here as well?

Cheers for the report, I hope you can find the root cause or confirm that the cause of the problem is indeed mkdx. Good luck!

on3iro commented 1 year ago

Yeah, as far as I can tell mkdx is the only plugin causing trouble right now. I'll let you know if I figure out what the issue is. Thanks for the response, anyway :)

on3iro commented 1 year ago

Ok I've finally found the culprit, it was this plugin I added: https://github.com/jiangmiao/auto-pairs

The reason why I didn't find this with my minimal init.lua file, was because I recently also switched to packer as a plugin manager and apparently packer keeps some stuff even when running with a minimal config file. So although I reverted back to a very old config of mine, It must've still interfered. I now switched back to vim-plug and got rid of everything packer related I could find (packer was a hassle in some other regards as well and the only cool feature I was using was the requires option.

Really glad I can use mkdx properly again, as its the backbone of my note-taking :D Thanks for making such a cool plugin - it's really useful to me!

SidOfc commented 1 year ago

Glad it's providing you with some useful features for note taking and good stuff on finding the actual cause! Indeed in some cases a lot of care has to be taken when configuring Vim/Neovim.

I've fallen into this exact trap before actually but it was easier to spot as it was auto loading some plugin which I thought I had disabled so I had a good hint as to where to look.

I must add though that mkdx is an aging plugin, it was also my very first venture into Vim plugins so a fair amount of code, while tested, is a bit tainted in that I did not build mkdx using such clean config 😅

What I plan to do at some point, when I have more time on my hands and am motivated enough, is to build a successor to mkdx in Lua, for Neovim only. The idea being that I'm not going to make the same mistakes, it'll also be some 10-100x faster because VimL is slow (I'm disregarding Vim9Script as I'm not interested in learning yet another bespoke language to write plugins).

That said, mkdx is not going to disappear all of a sudden, mkdx might be in feature freeze but bugfixes will still happen.

Anyways, went a bit off topic there, but felt like sharing some info, enjoy mkdx :)