SidOfc / mkdx

A vim plugin that adds some nice extra's for working with markdown documents

Home Page:https://www.vim.org/scripts/script.php?script_id=5620

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

text deleted when leading space present

martinra opened this issue · comments

OS type:

  • Unix (SuSE Tumbleweed)
  • Windows
  • Other ([SPECIFY])

Vim:

  • vim
  • neovim
  • Other ([SPECIFY])

Vim version:

NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc  -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=auto -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-5_1-2.1 -I/usr/include -I/usr/include/lua5.1 -I/home/abuild/rpmbuild/BUILD/neovim-0.9.0/build/src/nvim/auto -I/home/abuild/rpmbuild/BUILD/neovim-0.9.0/build/include -I/home/abuild/rpmbuild/BUILD/neovim-0.9.0/build/cmake.config -I/home/abuild/rpmbuild/BUILD/neovim-0.9.0/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

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

Reproduce steps:

On Neovim config with only

require('packer').startup({ function(use)
use {
  'SidOfc/mkdx',
  ft = { 'markdown' },
}
end})
  1. create empty markdown file
  2. insert test (mind the leading space) and
  3. still in insert mode hit enter.

Expected:

A new line is added after the current one. I.e. we should get

 test

with the cursor on the second line.

Actual:

The current line is deleted. I.e. we have


with the cursor on the start of that line.

Comment:

This phenomena occurs in a variety of situations, and I came to believe that the leading space as indicated in the title is the cause, but it is totally possible that this is only a special case of a more general criterion.

And thanks a lot for your work on this plugin. Very much appreciated!

Hello there, the issue should be patched now. I think my patch might affect multiple scenarios as well but that's something we'll have to see.

Let me know if the issue persists, cheers for the report 👍