Adds new option to create anchors on headings #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when the Table of Contents is created the links are built in the table of contents but no anchor is created on the titles.
This pull requests contains an optional feature that allows us to create an anchor with the following format:
The anchor is enclosed in the
fence-text
so it can be updated if theg:vmt_auto_update_on_save
option is enabled. So it can be deleted and updated in the same manner as the Table of Contents.To activate the new anchor creation options we do it by setting the variable:
Developer notes:
To implement this new feature we modify the return value of the folllowing
function:
function! s:GetHeadingLines()
Now we return an array containing a touple(represented by an array) with
the following content:
["heading", lineNum]
The lineNum represents the position of this heading, so we can later
decide to insert the anchor before the title.
The anchor option supports auto update when enabled.