Skip to content
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

Small g:markdown_minlines truncates set of <backtick>s (such as <backtick> class s{~s();} <backtick> text <backtick> class x{~x();} <backtick> to class s{~s();} <backtick> text <backtick> class x{~x();}, which has _strikethrough_ of s();} <backtick> text <backtick> class x{) #215

Open
SwuduSusuwu opened this issue Jul 31, 2024 · 2 comments

Comments

@SwuduSusuwu
Copy link

SwuduSusuwu commented Jul 31, 2024

Was told that this ( vim/vim#15406 ) is not an explicit problem with Vim's core, but with Vim's Markdown module.

The problem with sin sync fromstart or g:markdown_minlines 6666 (other than performance) is that this is just a local fix (does not suit open source projects which you contribute to).

@SwuduSusuwu SwuduSusuwu changed the title If g:markdown_minlines fits just the <tilde>s which close a code block, vim guesses that the <tilde>s open a code block (parses the syntax wrong) Small g:markdown_minlines truncates set of <backtick>s (such as <backtick> class s{~s();} <backtick> text <backtick> class x{~x();} <backtick> to class s{~s();} <backtick> text <backtick> class x{~x();}, which has _strikethrough_ of s();} <backtick> text <backtick> class x{) Jul 31, 2024
@SwuduSusuwu
Copy link
Author

SwuduSusuwu commented Jul 31, 2024

The problem is that the minlines window is small (which clips off the top of the block) to process the scripts fast, but Markdown must use the context of <backticks> which exists past this window.
Proposed fix: do not process Markdown across <backtick>s;
<backtick> (which begins or closes a code block) should have Markdown stop;
Thus <backtick> class s{~s();} <backtick> text <backtick> class x{~x();} <backtick> /
class s{~s();} <backtick> text <backtick> class x{~x();}
must both have the ~ ignored (as the ~ crosses <backtick>s).
If you do this, all sizes of minlines can process truth.

@SwuduSusuwu
Copy link
Author

SwuduSusuwu commented Jul 31, 2024

Proposed fix 2: post-/: if(1 & context_symbols['<backtick>'].size()) { execute("sin sync fromstart" /* or "let g:markdown_minlines 6666" */); }

The rest of vim's languages/syntaxes should have such fixes;
Proposed fix 2 is generalizable to: for(auto symbol : context_symbols) {if(1 & symbol.size()) { execute("sin sync fromstart" /* or "let g:markdown_minlines 6666" */); return; }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant