Compare commits
6 Commits
tin
...
v2022.03.15
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f1357472d | |||
| 2f1f497f88 | |||
| f55e700828 | |||
| 8bf4d6363c | |||
| 34ceee8aaa | |||
| cd5ef6c4c7 |
@@ -1,7 +1,7 @@
|
|||||||
# Copied from previous .travis.yml by tinmarino the 2023-03-09
|
# Copied from previous .travis.yml by tinmarino the 2023-03-09
|
||||||
|
|
||||||
# Commented out to avoid verbosity on github commit status
|
# Commented out to avoid verbosity on github commit status
|
||||||
#name: Main
|
name: CI
|
||||||
#description: Vimwiki CI test bank
|
#description: Vimwiki CI test bank
|
||||||
|
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|||||||
@@ -673,6 +673,7 @@ endfunction
|
|||||||
function! s:get_default_syntaxlocal() abort
|
function! s:get_default_syntaxlocal() abort
|
||||||
" Get default syntaxlocal variable dictionary
|
" Get default syntaxlocal variable dictionary
|
||||||
" type, default, min, max, possible_values, min_length
|
" type, default, min, max, possible_values, min_length
|
||||||
|
|
||||||
return extend(s:get_common_syntaxlocal(), {
|
return extend(s:get_common_syntaxlocal(), {
|
||||||
\ 'bold_match': {'type': type(''), 'default': '\%(^\|\s\|[[:punct:]]\)\@<=\*__Text__\*\%([[:punct:]]\|\s\|$\)\@='},
|
\ 'bold_match': {'type': type(''), 'default': '\%(^\|\s\|[[:punct:]]\)\@<=\*__Text__\*\%([[:punct:]]\|\s\|$\)\@='},
|
||||||
\ 'bold_search': {'type': type(''), 'default': '\%(^\|\s\|[[:punct:]]\)\@<=\*\zs\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)\ze\*\%([[:punct:]]\|\s\|$\)\@='},
|
\ 'bold_search': {'type': type(''), 'default': '\%(^\|\s\|[[:punct:]]\)\@<=\*\zs\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)\ze\*\%([[:punct:]]\|\s\|$\)\@='},
|
||||||
@@ -710,7 +711,7 @@ function! s:get_default_syntaxlocal() abort
|
|||||||
\ 'del': [['\~\~', '\~\~']],
|
\ 'del': [['\~\~', '\~\~']],
|
||||||
\ 'sup': [['\^', '\^']],
|
\ 'sup': [['\^', '\^']],
|
||||||
\ 'sub': [[',,', ',,']],
|
\ 'sub': [[',,', ',,']],
|
||||||
\ 'eq': [['\%(^\|[^$\\]\)\@<=\$\%($\|[^$]\)\@=', '\%(^\|[^$\\]\)\@<=\$\%($\|[^$]\)\@=']],
|
\ 'eq': [[s:rx_inline_math_start, s:rx_inline_math_end]],
|
||||||
\ }},
|
\ }},
|
||||||
\ 'wikilink': {'type': type(''), 'default': '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'},
|
\ 'wikilink': {'type': type(''), 'default': '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'},
|
||||||
\ })
|
\ })
|
||||||
@@ -763,7 +764,7 @@ function! s:get_markdown_syntaxlocal() abort
|
|||||||
\ 'del': [['\~\~', '\~\~']],
|
\ 'del': [['\~\~', '\~\~']],
|
||||||
\ 'sup': [['\^', '\^']],
|
\ 'sup': [['\^', '\^']],
|
||||||
\ 'sub': [[',,', ',,']],
|
\ 'sub': [[',,', ',,']],
|
||||||
\ 'eq': [['\%(^\|[^$]\)\@<=\$\%($\|[^$]\)\@=', '\%(^\|[^$]\)\@<=\$\%($\|[^$]\)\@=']],
|
\ 'eq': [[s:rx_inline_math_start, s:rx_inline_math_end]],
|
||||||
\ }},
|
\ }},
|
||||||
\ 'wikilink': {'type': type(''), 'default': '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'},
|
\ 'wikilink': {'type': type(''), 'default': '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'},
|
||||||
\ })
|
\ })
|
||||||
@@ -807,7 +808,7 @@ function! s:get_media_syntaxlocal() abort
|
|||||||
\ 'del': [['\~\~', '\~\~']],
|
\ 'del': [['\~\~', '\~\~']],
|
||||||
\ 'sup': [['\^', '\^']],
|
\ 'sup': [['\^', '\^']],
|
||||||
\ 'sub': [[',,', ',,']],
|
\ 'sub': [[',,', ',,']],
|
||||||
\ 'eq': [['\%(^\|[^$]\)\@<=\$\%($\|[^$]\)\@=', '\%(^\|[^$]\)\@<=\$\%($\|[^$]\)\@=']],
|
\ 'eq': [[s:rx_inline_math_start, s:rx_inline_math_end]],
|
||||||
\ }},
|
\ }},
|
||||||
\ 'wikilink': {'type': type(''), 'default': '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'},
|
\ 'wikilink': {'type': type(''), 'default': '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'},
|
||||||
\ })
|
\ })
|
||||||
@@ -815,10 +816,24 @@ endfunction
|
|||||||
|
|
||||||
function! s:get_common_syntaxlocal() abort
|
function! s:get_common_syntaxlocal() abort
|
||||||
let res = {}
|
let res = {}
|
||||||
|
|
||||||
|
" Declare helper: a line with only --- or ...
|
||||||
|
let rx_yaml_start_pre = '\%(^\%(\%1l\|^$\n\)\@<=\)'
|
||||||
|
let rx_yaml_start_post = '\%(\%(\n^$\)\@!$\)'
|
||||||
|
let rx_yaml_start = rx_yaml_start_pre . '---' . rx_yaml_start_post
|
||||||
|
let rx_yaml_stop = '^' . '\%(---\|\.\.\.\)' . '$'
|
||||||
|
|
||||||
let res.nested_extended = {'type': type(''), 'default': 'VimwikiError,VimwikiPre,VimwikiCode,VimwikiEqIn,VimwikiSuperScript,VimwikiSubScript,textSnipTEX'}
|
let res.nested_extended = {'type': type(''), 'default': 'VimwikiError,VimwikiPre,VimwikiCode,VimwikiEqIn,VimwikiSuperScript,VimwikiSubScript,textSnipTEX'}
|
||||||
let res.nested_typeface = {'type': type(''), 'default': 'VimwikiBold,VimwikiItalic,VimwikiUnderline,VimwikiDelText'}
|
let res.nested_typeface = {'type': type(''), 'default': 'VimwikiBold,VimwikiItalic,VimwikiUnderline,VimwikiDelText'}
|
||||||
let res.nested = {'type': type(''), 'default': res.nested_extended.default . ',' . res.nested_typeface.default}
|
let res.nested = {'type': type(''), 'default': res.nested_extended.default . ',' . res.nested_typeface.default}
|
||||||
let res.rxTableSep = {'type': type(''), 'default': '|'}
|
let res.rxTableSep = {'type': type(''), 'default': '|'}
|
||||||
|
" See issue #1287
|
||||||
|
let res.yaml_metadata_block = {'type': type([]), 'default': [[rx_yaml_start, rx_yaml_stop]]}
|
||||||
|
|
||||||
|
" Declare helper for inline math nested variable
|
||||||
|
let s:rx_inline_math_start = '\%(^\|[^$\\]\)\@<=\$\%($\|[^$[:space:]]\)\@='
|
||||||
|
let s:rx_inline_math_end = '\%(^\|[^$\\[:space:]]\)\@<=\$\%($\|[^$0-9]\)\@='
|
||||||
|
|
||||||
return res
|
return res
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
+18
-1
@@ -2938,7 +2938,9 @@ color. (See autoload/vimwiki/vars.vim)
|
|||||||
|
|
||||||
Syntax options are configured using the following pattern: >
|
Syntax options are configured using the following pattern: >
|
||||||
|
|
||||||
let g:vimwiki_syntax_list['markdown']['bullet_type'] = ['*', '-', '+']
|
let g:vimwiki_syntaxlocal_vars = {}
|
||||||
|
let g:vimwiki_syntaxlocal_vars['markdown'] = []
|
||||||
|
let g:vimwiki_syntaxlocal_vars['markdown']['bullet_type'] = ['*', '-', '+']
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
- `markdown` is the syntax name. It can be (`default`, `markdown` or `media`)
|
- `markdown` is the syntax name. It can be (`default`, `markdown` or `media`)
|
||||||
@@ -2946,6 +2948,16 @@ Where:
|
|||||||
- `['*', '-', '+']` is the option value
|
- `['*', '-', '+']` is the option value
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*yaml_metadata_block*
|
||||||
|
|
||||||
|
List of (start, end) regex region delimiters to define the YAML header
|
||||||
|
More information in #1287 and https://pandoc.org/MANUAL.html#extension-yaml_metadata_block
|
||||||
|
|
||||||
|
Default: [['^---$', '^\%(---\|\.\.\.$']]
|
||||||
|
or similar with stricter anchors
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
12.5 Global Options *vimwiki-global-options*
|
12.5 Global Options *vimwiki-global-options*
|
||||||
|
|
||||||
@@ -3999,6 +4011,11 @@ master is retained as a legacy mirror of the dev branch.
|
|||||||
|
|
||||||
This is somewhat experimental, and will probably be refined over time.
|
This is somewhat experimental, and will probably be refined over time.
|
||||||
|
|
||||||
|
New:~
|
||||||
|
* Issue #1287 Highlight YAML header with |yaml_metadata_block|
|
||||||
|
configuration variable holding region delimiters
|
||||||
|
|
||||||
|
|
||||||
2022.12.02~
|
2022.12.02~
|
||||||
|
|
||||||
New:~
|
New:~
|
||||||
|
|||||||
@@ -452,6 +452,8 @@ if str2nr(vimwiki#vars#get_global('key_mappings').links)
|
|||||||
call vimwiki#u#map_key('n', '+', '<Plug>VimwikiNormalizeLink')
|
call vimwiki#u#map_key('n', '+', '<Plug>VimwikiNormalizeLink')
|
||||||
call vimwiki#u#map_key('v', '+', '<Plug>VimwikiNormalizeLinkVisual')
|
call vimwiki#u#map_key('v', '+', '<Plug>VimwikiNormalizeLinkVisual')
|
||||||
call vimwiki#u#map_key('v', '<CR>', '<Plug>VimwikiNormalizeLinkVisualCR')
|
call vimwiki#u#map_key('v', '<CR>', '<Plug>VimwikiNormalizeLinkVisualCR')
|
||||||
|
call vimwiki#u#map_key('n', '<D-CR>', '<Plug>VimwikiTabDropLink')
|
||||||
|
call vimwiki#u#map_key('n', '<C-S-CR>', '<Plug>VimwikiTabDropLink', 1)
|
||||||
call vimwiki#u#map_key('n', '<BS>', '<Plug>VimwikiGoBackLink')
|
call vimwiki#u#map_key('n', '<BS>', '<Plug>VimwikiGoBackLink')
|
||||||
call vimwiki#u#map_key('n', '<TAB>', '<Plug>VimwikiNextLink')
|
call vimwiki#u#map_key('n', '<TAB>', '<Plug>VimwikiNextLink')
|
||||||
call vimwiki#u#map_key('n', '<S-TAB>', '<Plug>VimwikiPrevLink')
|
call vimwiki#u#map_key('n', '<S-TAB>', '<Plug>VimwikiPrevLink')
|
||||||
|
|||||||
@@ -508,6 +508,17 @@ if !empty(s:nested)
|
|||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Include: Yaml metadata block for pandoc
|
||||||
|
let a_yaml_delimiter = vimwiki#vars#get_syntaxlocal('yaml_metadata_block')
|
||||||
|
for [rx_start, rx_end] in a_yaml_delimiter
|
||||||
|
call vimwiki#base#nested_syntax(
|
||||||
|
\ 'yaml',
|
||||||
|
\ rx_start,
|
||||||
|
\ rx_end,
|
||||||
|
\ 'VimwikiPre')
|
||||||
|
endfor
|
||||||
|
|
||||||
|
|
||||||
" LaTex: Load
|
" LaTex: Load
|
||||||
if !empty(globpath(&runtimepath, 'syntax/tex.vim'))
|
if !empty(globpath(&runtimepath, 'syntax/tex.vim'))
|
||||||
execute 'syntax include @textGrouptex syntax/tex.vim'
|
execute 'syntax include @textGrouptex syntax/tex.vim'
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# Non regression tests for issue: #1287
|
||||||
|
|
||||||
|
|
||||||
|
Before(Define function for yaml inspection):
|
||||||
|
function! Issue1287Yaml(line)
|
||||||
|
" The line where the yaml delimiter is: 1 if at top
|
||||||
|
let l = a:line
|
||||||
|
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 0, 2)[0]
|
||||||
|
AssertEqual 'VimwikiPre', GetSyntaxStack(l + 0, 2)[1]
|
||||||
|
|
||||||
|
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 1, 2)[0]
|
||||||
|
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 2, 2)[0]
|
||||||
|
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 2, 20)[0]
|
||||||
|
|
||||||
|
AssertEqual 'VimwikiPre', GetSyntaxStack(l + 3, 2)[-1]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Yaml with --- at top):
|
||||||
|
---
|
||||||
|
title: my title
|
||||||
|
description: my description
|
||||||
|
---
|
||||||
|
|
||||||
|
Execute (Assert delimiter with --- at top):
|
||||||
|
call Issue1287Yaml(1)
|
||||||
|
|
||||||
|
Given vimwiki (Yaml with --- at bottom):
|
||||||
|
---
|
||||||
|
title: my title
|
||||||
|
description: my description
|
||||||
|
...
|
||||||
|
|
||||||
|
Execute (Assert delimiter with ... at bottom):
|
||||||
|
call Issue1287Yaml(1)
|
||||||
|
|
||||||
|
Given vimwiki (Yaml with --- after empty line):
|
||||||
|
A stupid block
|
||||||
|
of 2 lines
|
||||||
|
|
||||||
|
---
|
||||||
|
title: my title
|
||||||
|
description: my description
|
||||||
|
---
|
||||||
|
|
||||||
|
Execute (Assert delimiter with --- after empty line):
|
||||||
|
call Issue1287Yaml(4)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Yaml with --- mixed with ...):
|
||||||
|
---
|
||||||
|
title: my title
|
||||||
|
...
|
||||||
|
comment: my comment
|
||||||
|
description: my description
|
||||||
|
---
|
||||||
|
|
||||||
|
And a text follows
|
||||||
|
|
||||||
|
Execute (Assert all is yaml except after the closing ---):
|
||||||
|
AssertEqual 'textSnipYAML1', GetSyntaxStack(1, 2)[0] . 1
|
||||||
|
AssertEqual 'VimwikiPre1', GetSyntaxStack(1, 2)[1] . 1
|
||||||
|
|
||||||
|
AssertEqual 'textSnipYAML1', GetSyntaxStack(1, 2)[0] . 1
|
||||||
|
AssertEqual 'textSnipYAML2', GetSyntaxStack(2, 2)[0] . 2
|
||||||
|
AssertEqual 'VimwikiPre3', GetSyntaxStack(3, 2)[0] . 3
|
||||||
|
|
||||||
|
AssertEqual 0, len(GetSyntaxStack(7, 2))
|
||||||
|
AssertEqual 0, len(GetSyntaxStack(8, 2))
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Yaml with --- with a --- not a start of line):
|
||||||
|
---
|
||||||
|
title: my title
|
||||||
|
comment: my comment ---
|
||||||
|
description: my description
|
||||||
|
---
|
||||||
|
|
||||||
|
And a text follows
|
||||||
|
|
||||||
|
Execute (Assert all is yaml except after the closing ---):
|
||||||
|
AssertEqual 'textSnipYAML1', GetSyntaxStack(1, 2)[0] . 1
|
||||||
|
AssertEqual 'VimwikiPre1', GetSyntaxStack(1, 2)[1] . 1
|
||||||
|
|
||||||
|
AssertEqual 'textSnipYAML1', GetSyntaxStack(1, 2)[0] . 1
|
||||||
|
AssertEqual 'textSnipYAML2', GetSyntaxStack(2, 2)[0] . 2
|
||||||
|
AssertEqual 'textSnipYAML3', GetSyntaxStack(3, 2)[0] . 3
|
||||||
|
AssertEqual 'textSnipYAML4', GetSyntaxStack(4, 2)[0] . 4
|
||||||
|
AssertEqual 'VimwikiPre5', GetSyntaxStack(5, 2)[-1] . 5
|
||||||
|
|
||||||
|
AssertEqual 0, len(GetSyntaxStack(6, 2))
|
||||||
|
AssertEqual 0, len(GetSyntaxStack(7, 2))
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# Non regression tests for issue: #150
|
||||||
|
# -- How to turn off inline math highlights?
|
||||||
|
|
||||||
|
# From: https://pandoc.org/MANUAL.html#math
|
||||||
|
# Anything between two $ characters will be treated as TeX math. The opening $ must have a non-space character immediately to its right, while the closing $ must have a non-space character immediately to its left, and must not be followed immediately by a digit. Thus, $20,000 and $30,000 won’t parse as math. If for some reason you need to enclose text in literal $ characters, backslash-escape them and they won’t be treated as math delimiters.
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (All math inline possible):
|
||||||
|
12345678901234567890 # 01 Just a counter
|
||||||
|
This $math \sum{2, 3}$ # 02 Math no trap
|
||||||
|
$This math 3 \times 4 = 12$ # 03 Math all line
|
||||||
|
This $3 and $4 is not math # 04 Not math as the last $ is followed by 4
|
||||||
|
This 3$ and 4$ is not math # 05 Not math as the first $ is folowed by space
|
||||||
|
This \$3 and $4 is not math at all # 06 Not math as first escaped
|
||||||
|
This $3 and \$4 is not math at all # 07 Not math as last escaped
|
||||||
|
This \$3 and \$4 is not math at all # 08 Not math as both escaped
|
||||||
|
This $is not math either $320 # 09 Not math as last followd by number (bis)
|
||||||
|
|
||||||
|
Execute (Assert all lines):
|
||||||
|
# Hi
|
||||||
|
Log 'Normal: ' . string(GetSyntaxStack(1, 10))
|
||||||
|
Log 'Math: ' . string(GetSyntaxStack(2, 10))
|
||||||
|
AssertEqual '01', len(GetSyntaxStack(1, 10)) . 1
|
||||||
|
|
||||||
|
# Math
|
||||||
|
AssertEqual 'textSnipTEX2', GetSyntaxStack(2, 10)[0] . 2
|
||||||
|
AssertEqual 'textSnipTEX3', GetSyntaxStack(3, 10)[0] . 3
|
||||||
|
|
||||||
|
# Not Math
|
||||||
|
AssertEqual '04', len(GetSyntaxStack(10, 4)) . 4
|
||||||
|
AssertEqual '05', len(GetSyntaxStack(10, 5)) . 5
|
||||||
|
AssertEqual '06', len(GetSyntaxStack(10, 6)) . 6
|
||||||
|
AssertEqual '07', len(GetSyntaxStack(10, 7)) . 7
|
||||||
|
AssertEqual '08', len(GetSyntaxStack(10, 8)) . 8
|
||||||
|
AssertEqual '09', len(GetSyntaxStack(10, 9)) . 9
|
||||||
+6
-6
@@ -172,7 +172,7 @@ Execute (Assert Done Syntax 2):
|
|||||||
Given vimwiki (Extended Types mono):
|
Given vimwiki (Extended Types mono):
|
||||||
`code `
|
`code `
|
||||||
~~ strike ~~
|
~~ strike ~~
|
||||||
$ equation $
|
$equation$
|
||||||
^superscript ^
|
^superscript ^
|
||||||
,, subscript ,,
|
,, subscript ,,
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ Execute (Assert Syntax extended types x 1):
|
|||||||
Given vimwiki (Extended Types nested in basic):
|
Given vimwiki (Extended Types nested in basic):
|
||||||
From __bold `code in bold ` end of bold__ morF
|
From __bold `code in bold ` end of bold__ morF
|
||||||
From _it and ~~ strieout in i~~ end of it_ morF
|
From _it and ~~ strieout in i~~ end of it_ morF
|
||||||
From __bold $ equation $ end bold __
|
From __bold $equation$ end bold __
|
||||||
**bold ^superscript ^ end of bold morF**
|
**bold ^superscript ^ end of bold morF**
|
||||||
From normal ,, subscript ,, still normal morF
|
From normal ,, subscript ,, still normal morF
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ Execute (Assert Syntax extended types x 2):
|
|||||||
Given vimwiki (Extended Types nested in extended):
|
Given vimwiki (Extended Types nested in extended):
|
||||||
From ^super to`code this ` is crazy but^ morF
|
From ^super to`code this ` is crazy but^ morF
|
||||||
From ,,sub to~~ strike ~~why not,, morF
|
From ,,sub to~~ strike ~~why not,, morF
|
||||||
From ~~strike $ equation $ end of strike~~morF
|
From ~~strike $eequationeeeee$ end of strike~~morF
|
||||||
From $eq to ^super ^ Just inline morF$
|
From $eq to ^super ^ Just inline morF$
|
||||||
From ^super t,,sub ,, end super eol ^
|
From ^super t,,sub ,, end super eol ^
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ Execute (Assert Syntax extended types nested in extended):
|
|||||||
Given vimwiki (Basic Types nested in extended):
|
Given vimwiki (Basic Types nested in extended):
|
||||||
From ^super __bold __ is crazy but^ morF
|
From ^super __bold __ is crazy but^ morF
|
||||||
From ,,sub _italic with en_ aaaaaaa,, morF
|
From ,,sub _italic with en_ aaaaaaa,, morF
|
||||||
From $eq to **boldboldboldbo** aaaaaaaaa $
|
From $eq to **boldboldboldbo** aaaaaaaaa$ $
|
||||||
From ^super *italic aaaaaaa*aaaaaaaaaaaaaaaaaaaaa
|
From ^super *italic aaaaaaa*aaaaaaaaaaaaaaaaaaaaa
|
||||||
From ~~strik __bbbbbbbbbbbbb__ssssssssssssssssss~~
|
From ~~strik __bbbbbbbbbbbbb__ssssssssssssssssss~~
|
||||||
|
|
||||||
@@ -721,7 +721,7 @@ Execute (Assert Code syntax):
|
|||||||
#######################
|
#######################
|
||||||
|
|
||||||
Given vimwiki (Math markdown):
|
Given vimwiki (Math markdown):
|
||||||
math inline: $ aaaaaaaaaaaaaa \sum_i a_i^2 = 1 $
|
math inline: $aaaaaaaaaaaaaaa \sum_i a_i^2 = 1 end$
|
||||||
|
|
||||||
math block:
|
math block:
|
||||||
$$
|
$$
|
||||||
@@ -751,7 +751,7 @@ Execute (Assert math syntax 1):
|
|||||||
##############################
|
##############################
|
||||||
|
|
||||||
Given vimwiki (Math wiki):
|
Given vimwiki (Math wiki):
|
||||||
math inline: $aaaaaaaaaaaaaaaaaaaaaaaaaa \sum_i a_i^2 = 1 $
|
math inline: $aaaaaaaaaaaaaaaaaaaaaaaaaa \sum_i a_i^2 = 1$
|
||||||
|
|
||||||
math block:
|
math block:
|
||||||
{{$
|
{{$
|
||||||
|
|||||||
+22
-6
@@ -343,21 +343,37 @@
|
|||||||
0d
|
0d
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! GetSyntaxGroup(line, col)
|
function! GetSyntaxGroup(...)
|
||||||
" Get normalized syntax group: usefull for boldItalic Vs italicBold
|
" Get normalized syntax group: usefull for boldItalic Vs italicBold
|
||||||
|
" Arg1: line
|
||||||
|
" Arg2: column
|
||||||
" -- Here, Vader's SyntaxAt is not enough
|
" -- Here, Vader's SyntaxAt is not enough
|
||||||
" From: https://stackoverflow.com/questions/9464844
|
" From: https://stackoverflow.com/questions/9464844
|
||||||
let l:s = synID(a:line, a:col, 1)
|
let line = a:0 >= 1 ? a:1 : '.'
|
||||||
|
let col = a:0 >= 2 ? a:2 : '.'
|
||||||
|
|
||||||
|
let l:s = synID(line, col, 1)
|
||||||
return synIDattr(synIDtrans(l:s), 'name')
|
return synIDattr(synIDtrans(l:s), 'name')
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
function! GetSyntaxStack()
|
function! GetSyntaxStack(...)
|
||||||
" Debug helper
|
" Debug helper
|
||||||
|
" Arg1: line
|
||||||
|
" Arg2: column
|
||||||
|
let line = a:0 >= 1 ? a:1 : '.'
|
||||||
|
let col = a:0 >= 2 ? a:2 : '.'
|
||||||
if !exists('*synstack')
|
if !exists('*synstack')
|
||||||
return
|
return []
|
||||||
endif
|
endif
|
||||||
return map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
|
let res = map(synstack(line, col), 'synIDattr(v:val, "name")')
|
||||||
endfunc
|
|
||||||
|
" For old vim version returning 0
|
||||||
|
if type(res) == type(0) && res == 0
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
return res
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! AssertIfVersion(version, one, two)
|
function! AssertIfVersion(version, one, two)
|
||||||
" Run Assert only if vim version is high enough
|
" Run Assert only if vim version is high enough
|
||||||
|
|||||||
Reference in New Issue
Block a user