Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
John Tobin [Mon, 18 Mar 2019 22:39:43 +0000 (22:39 +0000)]
Remove user directories from runtimepath.
The default value of runtimepath includes ~/.vim and ~/.vim/after.
Configuration in those directories can interfere with tests. Remove
those directories from runtimepath to make the tests hermetic.
John Tobin [Sun, 17 Mar 2019 19:16:16 +0000 (19:16 +0000)]
Fix folding broken by other syntax highlighting.
When syntax highlighting is enabled for fenced code blocks, the syntax
highlighting of the language in the code block can overwrite folding
configuration, breaking Markdown folding. Reinitialise Markdown folding
configuration every time syntax highlighting is refreshed to ensure that
Markdown folding works.
David Briscoe [Fri, 7 Dec 2018 00:45:35 +0000 (16:45 -0800)]
Prevent repeated sourcing of syntax
Bug: Using `vim --startuptime ~/time.log name.md` would show multiple
sourcing of syntax/markdown.vim indicating unnecessary startup cost.
Cause: As of vim/vim@7d76c804af900ba6dcc4b1e45373ccab3418c6b2, vim uses
.md for markdown instead of modula2. Since vim-markdown was using `set
filetype`, it was sourcing the files a second time after vim's runtime
files had already set the filetype.
Resolution: Using `setfiletype` prevents this double sourcing. To remain
backwards compatible, we remove the .md filetype detection for modula2
on old versions.
Related to sheerun/vim-polyglot#290.
Tested .md ftdetection with vim 7.4.052 and 8.1.527.
Josh Holland [Tue, 23 Oct 2018 21:10:01 +0000 (22:10 +0100)]
Fix detection of YAML frontmatter ending with "..."
PR #374 introduced a bug which would cause any line containing exactly
three characters to be highlighted as the end of a YAML frontmatter
block; this commit fixes that, so that only three dots will end the
block.
Shane Pearman [Fri, 30 Jun 2017 00:19:54 +0000 (17:19 -0700)]
Change mkdRule match syntax to be more liberal
Consider any line beginning with 3 or more of '*', '-', or '_' with
possible spaces before and between, possibly followed by zero or more of
the previously matched symbols or spaces to be a horizontal rule.
memeplex [Sat, 25 Feb 2017 19:33:28 +0000 (16:33 -0300)]
Allow local anchors and improve buffer filename.
Now urls of the form #anchor works (by searching the -transformed-
anchor in the current buffer).
I've fixed the new buffer file naming code in two senses (and note that
both are unrelated to named anchors, but since the problem it's in the
same part of the code I decided to include the fix here):
1. The previous code only expanded the filename relative to the current
file when vim_markdown_no_extensions_in_markdown was set, but
concatenation of .md is unrelated to filename expansion.
2. The previous code was expanding relative to the home dir (:~) then
making the path absolute (:p), which made not much sense and also
produced long, absolute, buffer names. Now the full path is computed
relative to the current file but the buffer is named relative to the
current working directory (:.).
memeplex [Wed, 22 Feb 2017 16:52:36 +0000 (13:52 -0300)]
Follow named anchors with ge
This commit allows ge to follow named anchors in links of the form
file#anchor, where file may omit the .md extension as usual.
Two global variables control the operation of this feature:
vim_markdown_follow_anchor: a flag that tells vim-markdown whether
to attempt to follow a named anchor in a link or not. When this is
1, and only if a link can be split in exactly two parts by the
pattern '#', then the first part is interpreted as the file and the
second one as the named anchor. After the file is opened, the anchor
will be searched.
vim_markdown_anchorexpr: if available this expression will be
evaluated substituting v:anchor with a quoted string that contains
the anchor to visit. The result of the evaluation will become the
real anchor to search in the target file. This is useful in order to
convert anchors of the form my-section-title to searches of the form
My Section Title. It needs to be generic since every markdown
renderer follows its own conventions to generate "auto-anchors".
A dummy example: let vim_markdown_anchorexpr = "'<<'.v:anchor"
Note: I've also reformatted EditUrlUnderCursor a bit since it was
violating the 4-space tab and single-quoted string conventions that most
of the rest of the code seems to follow.
Option to not require .md extensions in markdown links
Gitlab uses markdown in an interesting way. If you want to create a link
to the page "linked-to-page" you might do this:
[Linked To Page Title](linked-to-page)
And not,
[Linked To Page Title](linked-to-page.md)
This change is about having the "ge" command work on wiki links
constructed in this way, and provides consistency between how gitlab
works and vim-markdown works.