-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using o and enter on code blocks deletes the line #143
Comments
Hello @m-fonseca, yeah this was another thing I overlooked, I naively thought most folks would just use fenced code blocks 😅 Anyways, this would normally be quite tricky to properly detect since list items can also be at an indent level of 4 so I can't assume every line with indent of 4 will be an indented code block. To "guess" correctly I'm using a bit of help from syntax highlighting, essentially if the cursor line is a With normal I mean that pressing either enter / o will indent the next line as well, and if you press enter on that newly added empty line again it will de-indent. Let me know if this is working properly for you, feel free to reopen if the issue persists. |
Seems to be working now. Thanks! |
I found one other case where the
do |
@m-fonseca this one is also fixed now. It is not exactly invalid markdown but the |
Verified. Thanks for the fix! |
Compatible with Pandoc? pandoc and it's syntax defined some highlight name, such as Temporarily, I changed: Line 1917 in a6fc41f
To: if (index(cursor_line_hl, 'pandocDelimitedCodeBlock') > -1 || index(cursor_line_hl, 'markdownCodeBlock' ) > -1 || index(cursor_line_hl, 'markdownCode') > -1) Otherwise, using |
Hello @lclrc, Cheers for the example code which shows clearly what you want to achieve, and if I understand correctly, it also fixes your issue as well right? If this is the case, would you mind opening a PR with this fix? Additionally, I appreciate the effort of you looking for similar issues before just opening a new one 👍. That said, this would have been a solid issue by itself since this is specifically about vim-pandoc and it causes the problem described in this issue :) Thank you for your time and contribution to mkdx.vim! 🚀 |
@SidOfc Sorry for my late reply! Github did not notify me. :(
yes, but I think the example code is "hard code", maybe I need to test its stability and functionality. And then I will open a PR. :) |
OS type:
Vim:
Vim version:
NVIM v0.4.4
Using mkdx 602a784
Reproduce steps:
Use the following markdown file.
indented code block
press enter.Expected:
The cursor goes to next line.
Actual:
The line is deleted 🤯 . Note: the same happens when pressing 'o' while the cursor is on
indented code block
lineI thought I had a conflict with all my mods, so I created a clean setup with no mods except this one, and a init.vim like below, and it still exhibits the problem.
Thanks!
The text was updated successfully, but these errors were encountered: