Compare commits
6 Commits
v2022.12.02
..
tin
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d4208157d | |||
| 48ce5b811d | |||
| acff8a5b1d | |||
| 59402cdf8b | |||
| fea8bee382 | |||
| 6d87df76cb |
@@ -1,7 +1,6 @@
|
|||||||
Prior to submitting a new issue make sure to complete these steps:
|
Prior to submitting a new issue make sure to complete these steps:
|
||||||
|
|
||||||
- [ ] Checkout the `dev` branch and confirm the issue is present there as well.
|
- [ ] Include the VimWiki settings from your `.vimrc`
|
||||||
The `dev` branch contains fixes that may not have been merged to `master` yet.
|
- [ ] Include the syntax you are using (default / Markdown / MediaWiki)
|
||||||
- [ ] Post the syntax you are using (default/mediawiki/markdown) **and** your vimwiki settings from your `.vimrc`
|
|
||||||
- [ ] Provide a detailed description of the problem including **steps to reproduce the issue**.
|
- [ ] Provide a detailed description of the problem including **steps to reproduce the issue**.
|
||||||
- [ ] Include the output of `:VimwikiShowVersion`.
|
- [ ] Include the output of `:VimwikiShowVersion`.
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
# Copied from previous .travis.yml by tinmarino the 2023-03-09
|
||||||
|
|
||||||
|
# Commented out to avoid verbosity on github commit status
|
||||||
|
#name: Main
|
||||||
|
#description: Vimwiki CI test bank
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Typos:
|
||||||
|
# Copyed from: https://github.com/junegunn/fzf/blob/master/.github/workflows/typos.yml
|
||||||
|
name: Typos
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: crate-ci/typos@v1.13.16
|
||||||
|
with:
|
||||||
|
config: ./test/resources/typos_config.toml
|
||||||
|
|
||||||
|
|
||||||
|
Vint:
|
||||||
|
# Copyed from: https://github.com/LudvigHz/vint-action
|
||||||
|
# And local test/run_test.sh
|
||||||
|
name: Vint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: ludvighz/vint-action@v1
|
||||||
|
with:
|
||||||
|
path: .
|
||||||
|
args: --style-problem
|
||||||
|
- uses: ludvighz/vint-action@v1
|
||||||
|
with:
|
||||||
|
path: test/vimrc
|
||||||
|
args: --style-problem
|
||||||
|
|
||||||
|
|
||||||
|
Check:
|
||||||
|
name: Check ${{ matrix.opt }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
opt: [
|
||||||
|
#"vint",
|
||||||
|
|
||||||
|
"-n vim_7.3.429",
|
||||||
|
"-n vim_8.1.0519",
|
||||||
|
# TODO add me when test works on Vim, 9.0
|
||||||
|
# -- Currently I experienced some surprised due to defaults
|
||||||
|
# -- tinmarino 2023-03-10
|
||||||
|
# "-n v9.0.1396",
|
||||||
|
|
||||||
|
"-n nvim_0.3.8",
|
||||||
|
|
||||||
|
# Cannot quote as it is expanded from $OPT after quote removal
|
||||||
|
# So I decided to escape the *
|
||||||
|
"-n vim_7.4.1099 -f '[a-k]*.vader'",
|
||||||
|
"-n vim_7.4.1546 -f 'l*.vader'",
|
||||||
|
"-n vim_8.0.0027 -f '[m-z]*.vader'",
|
||||||
|
]
|
||||||
|
steps:
|
||||||
|
# This action is required to fetch the code to test
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# This action is crafting the docker image from the root Docker file
|
||||||
|
# or will use it is exists in cache
|
||||||
|
# It caches in GHA for GitHub Actions with 10 Gb
|
||||||
|
# See: https://github.com/moby/buildkit#github-actions-cache-experimental
|
||||||
|
# Examples at: https://github.com/docker/build-push-action/blob/
|
||||||
|
# e27bcee4eb9e7b4bc168418e3364c4482120393a/docs/advanced/cache.md
|
||||||
|
- uses: docker/setup-buildx-action@v2
|
||||||
|
- uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
|
tags: vimwiki:latest
|
||||||
|
load: true
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
|
||||||
|
- name: Check
|
||||||
|
run: |
|
||||||
|
pushd test
|
||||||
|
if [[ "$OPT" == 'vint' ]]; then
|
||||||
|
bash run_tests.sh -v -t vint;
|
||||||
|
else
|
||||||
|
bash run_tests.sh -v -t vader $OPT;
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
env:
|
||||||
|
OPT: ${{ matrix.opt }}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
# No language: we download vim and compile it oursselves
|
# No language: we download vim and compile it oursselves
|
||||||
|
# WARNING: This file is OBSOLETE since travis CI is making us pay
|
||||||
|
# to get execution.
|
||||||
|
# See Github Actions at .github/workflows/test-vader-action.yml
|
||||||
|
|
||||||
|
|
||||||
language: generic
|
language: generic
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
|
|||||||
+8
-7
@@ -15,11 +15,12 @@ WORKDIR /vader
|
|||||||
RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c
|
RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c
|
||||||
|
|
||||||
# Build vim and neovim versions we want to test
|
# Build vim and neovim versions we want to test
|
||||||
# TODO add nvim tag
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \
|
|
||||||
-tag v7.4.1099 -name vim_7.4.1099 -build \
|
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build
|
||||||
-tag v7.4.1546 -name vim_7.4.1546 -build \
|
RUN install_vim -tag v7.4.1099 -name vim_7.4.1099 -build
|
||||||
-tag v8.0.0027 -name vim_8.0.0027 -build \
|
RUN install_vim -tag v7.4.1546 -name vim_7.4.1546 -build
|
||||||
-tag v8.1.0519 -name vim_8.1.0519 -build \
|
RUN install_vim -tag v8.0.0027 -name vim_8.0.0027 -build
|
||||||
-tag neovim:v0.3.8 -name nvim_0.3.8 -build \
|
RUN install_vim -tag v8.1.0519 -name vim_8.1.0519 -build
|
||||||
|
RUN install_vim -tag v9.0.1396 -name v9.0.1396 -build
|
||||||
|
RUN install_vim -tag neovim:v0.3.8 -name nvim_0.3.8 -build
|
||||||
|
|||||||
+44
-31
@@ -500,7 +500,7 @@ function! vimwiki#base#goto(...) abort
|
|||||||
" Save current file pos
|
" Save current file pos
|
||||||
let vimwiki_prev_link = [vimwiki#path#current_wiki_file(), getpos('.')]
|
let vimwiki_prev_link = [vimwiki#path#current_wiki_file(), getpos('.')]
|
||||||
|
|
||||||
call vimwiki#base#edit_file(':e',
|
call vimwiki#base#edit_file('edit',
|
||||||
\ vimwiki#vars#get_wikilocal('path') . key . vimwiki#vars#get_wikilocal('ext'),
|
\ vimwiki#vars#get_wikilocal('path') . key . vimwiki#vars#get_wikilocal('ext'),
|
||||||
\ anchor,
|
\ anchor,
|
||||||
\ vimwiki_prev_link,
|
\ vimwiki_prev_link,
|
||||||
@@ -664,7 +664,7 @@ function! vimwiki#base#get_anchors(filename, syntax) abort
|
|||||||
let h_match = matchlist(line, rxheader)
|
let h_match = matchlist(line, rxheader)
|
||||||
if !empty(h_match)
|
if !empty(h_match)
|
||||||
let header = vimwiki#base#normalize_anchor(h_match[2])
|
let header = vimwiki#base#normalize_anchor(h_match[2])
|
||||||
" Mesure: header level
|
" Measure: header level
|
||||||
let level = len(h_match[1])
|
let level = len(h_match[1])
|
||||||
call add(anchors, header)
|
call add(anchors, header)
|
||||||
let anchor_level[level-1] = header
|
let anchor_level[level-1] = header
|
||||||
@@ -755,7 +755,7 @@ function! vimwiki#base#normalize_anchor(anchor, ...) abort
|
|||||||
|
|
||||||
" 4 Append '-1', '-2', '-3',... to make it unique <= If that not unique
|
" 4 Append '-1', '-2', '-3',... to make it unique <= If that not unique
|
||||||
if has_key(previous_anchors, anchor)
|
if has_key(previous_anchors, anchor)
|
||||||
" Inc anchor number (before modifing the anchor)
|
" Inc anchor number (before modifying the anchor)
|
||||||
let anchor_nb = previous_anchors[anchor] + 1
|
let anchor_nb = previous_anchors[anchor] + 1
|
||||||
let previous_anchors[anchor] = anchor_nb
|
let previous_anchors[anchor] = anchor_nb
|
||||||
" Append suffix
|
" Append suffix
|
||||||
@@ -816,7 +816,7 @@ function! vimwiki#base#unnormalize_anchor(anchor) abort
|
|||||||
" For each char
|
" For each char
|
||||||
let anchor_loop = ''
|
let anchor_loop = ''
|
||||||
for char in split(anchor, '\zs')
|
for char in split(anchor, '\zs')
|
||||||
" Nest the char for easyer debugging
|
" Nest the char for easier debugging
|
||||||
let anchor_loop .= '\%('
|
let anchor_loop .= '\%('
|
||||||
|
|
||||||
" 3 Change any space to a hyphen
|
" 3 Change any space to a hyphen
|
||||||
@@ -825,7 +825,7 @@ function! vimwiki#base#unnormalize_anchor(anchor) abort
|
|||||||
let anchor_loop .= invisible_rx.'\+'
|
let anchor_loop .= invisible_rx.'\+'
|
||||||
|
|
||||||
" 2 Remove anything that is not a letter, number, CJK character, hyphen or space
|
" 2 Remove anything that is not a letter, number, CJK character, hyphen or space
|
||||||
" -- So add puncutation regex at each char
|
" -- So add punctuation regex at each char
|
||||||
else
|
else
|
||||||
" Match My_char . punctuation . ( link . punctuaction )?
|
" Match My_char . punctuation . ( link . punctuaction )?
|
||||||
" Note: Because there may be punctuation before ad after link
|
" Note: Because there may be punctuation before ad after link
|
||||||
@@ -847,7 +847,7 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! s:jump_to_anchor(anchor) abort
|
function! s:jump_to_anchor(anchor) abort
|
||||||
" Jump: to anchor, doing the oposite of normalize_anchor
|
" Jump: to anchor, doing the opposite of normalize_anchor
|
||||||
" Called: edit_file
|
" Called: edit_file
|
||||||
" Get segments <= anchor
|
" Get segments <= anchor
|
||||||
let anchor = vimwiki#u#escape(a:anchor)
|
let anchor = vimwiki#u#escape(a:anchor)
|
||||||
@@ -886,7 +886,7 @@ function! s:jump_to_segment(segment, segment_norm_re, segment_nb) abort
|
|||||||
\ vimwiki#vars#get_syntaxlocal('tag_match'),
|
\ vimwiki#vars#get_syntaxlocal('tag_match'),
|
||||||
\ '__Tag__', a:segment, 'g')
|
\ '__Tag__', a:segment, 'g')
|
||||||
|
|
||||||
" Go: Move cursor: maybe more than onces (see markdown suffix)
|
" Go: Move cursor: maybe more than once (see markdown suffix)
|
||||||
let success_nb = 0
|
let success_nb = 0
|
||||||
let is_last_segment = 0
|
let is_last_segment = 0
|
||||||
for i in range(a:segment_nb)
|
for i in range(a:segment_nb)
|
||||||
@@ -898,7 +898,7 @@ function! s:jump_to_segment(segment, segment_norm_re, segment_nb) abort
|
|||||||
|
|
||||||
" Succeed: Get the result and reloop or leave
|
" Succeed: Get the result and reloop or leave
|
||||||
if pos != 0
|
if pos != 0
|
||||||
" Avance, one line more to not rematch the same pattern if not last segment_nb
|
" Advance, one line more to not rematch the same pattern if not last segment_nb
|
||||||
if success_nb < a:segment_nb-1
|
if success_nb < a:segment_nb-1
|
||||||
let pos += 1
|
let pos += 1
|
||||||
let is_last_segment = -1
|
let is_last_segment = -1
|
||||||
@@ -1102,7 +1102,7 @@ endfunction
|
|||||||
function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
|
function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
|
||||||
" Edit File: (like :e)
|
" Edit File: (like :e)
|
||||||
" :param: command <string>: ':e'
|
" :param: command <string>: ':e'
|
||||||
" :param: filename <strign> vimwiki#vars#get_wikilocal('path') . key . vimwiki#vars#get_wikilocal('ext')
|
" :param: filename <string> vimwiki#vars#get_wikilocal('path') . key . vimwiki#vars#get_wikilocal('ext')
|
||||||
" :param: anchor
|
" :param: anchor
|
||||||
" :param: (1) vimwiki_prev_link
|
" :param: (1) vimwiki_prev_link
|
||||||
" :param: (2) vimwiki#u#ft_is_vw()
|
" :param: (2) vimwiki#u#ft_is_vw()
|
||||||
@@ -1117,10 +1117,10 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Check if the file we want to open is already the current file
|
" Check if the file we want to open is already the current file
|
||||||
" which happens if we jump to an achor in the current file.
|
" which happens if we jump to an anchor in the current file.
|
||||||
" This hack is necessary because apparently Vim messes up the result of
|
" This hack is necessary because apparently Vim messes up the result of
|
||||||
" getpos() directly after this command. Strange.
|
" getpos() directly after this command. Strange.
|
||||||
if !(a:command ==# ':e ' && vimwiki#path#is_equal(a:filename, expand('%:p')))
|
if !(a:command =~# ':\?[ed].*' && vimwiki#path#is_equal(a:filename, expand('%:p')))
|
||||||
try
|
try
|
||||||
execute a:command fname
|
execute a:command fname
|
||||||
catch /E37:/
|
catch /E37:/
|
||||||
@@ -1130,6 +1130,10 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
|
|||||||
catch /E325:/
|
catch /E325:/
|
||||||
call vimwiki#u#warn('Vim couldn''t open the file, probably because a swapfile already exists. See :h E325.')
|
call vimwiki#u#warn('Vim couldn''t open the file, probably because a swapfile already exists. See :h E325.')
|
||||||
return
|
return
|
||||||
|
catch /E319:/
|
||||||
|
call vimwiki#u#warn('Vim couldn''t open the file, cannot launch the drop command. See :h E319.')
|
||||||
|
execute 'edit' fname
|
||||||
|
return
|
||||||
endtry
|
endtry
|
||||||
" If the opened file was not already loaded by Vim, an autocommand is
|
" If the opened file was not already loaded by Vim, an autocommand is
|
||||||
" triggered at this point
|
" triggered at this point
|
||||||
@@ -1391,7 +1395,7 @@ endfunction
|
|||||||
function! s:open_wiki_buffer(item) abort
|
function! s:open_wiki_buffer(item) abort
|
||||||
" Edit wiki file.
|
" Edit wiki file.
|
||||||
" Called: by rename_file: Usefull for buffer commands
|
" Called: by rename_file: Usefull for buffer commands
|
||||||
call vimwiki#base#edit_file(':e', a:item[0], '')
|
call vimwiki#base#edit_file('edit', a:item[0], '')
|
||||||
if !empty(a:item[1])
|
if !empty(a:item[1])
|
||||||
call vimwiki#vars#set_bufferlocal('prev_links', a:item[1], a:item[0])
|
call vimwiki#vars#set_bufferlocal('prev_links', a:item[1], a:item[0])
|
||||||
endif
|
endif
|
||||||
@@ -1421,7 +1425,7 @@ function! vimwiki#base#nested_syntax(filetype, start, end, textSnipHl) abort
|
|||||||
" attempting to include them.
|
" attempting to include them.
|
||||||
" https://vi.stackexchange.com/a/10354
|
" https://vi.stackexchange.com/a/10354
|
||||||
" Previously, this used a try/catch block to intercept any errors thrown
|
" Previously, this used a try/catch block to intercept any errors thrown
|
||||||
" when attempting to include files. The error(s) interferred with running
|
" when attempting to include files. The error(s) interfered with running
|
||||||
" with Vader tests (specifically, testing VimwikiSearch).
|
" with Vader tests (specifically, testing VimwikiSearch).
|
||||||
if !empty(globpath(&runtimepath, 'syntax/'.a:filetype.'.vim'))
|
if !empty(globpath(&runtimepath, 'syntax/'.a:filetype.'.vim'))
|
||||||
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
|
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
|
||||||
@@ -1651,7 +1655,7 @@ function! vimwiki#base#follow_link(split, ...) abort
|
|||||||
\ vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl'))
|
\ vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl'))
|
||||||
if lnk !=# ''
|
if lnk !=# ''
|
||||||
if lnk !~# '\%(\%('.vimwiki#vars#get_global('schemes_web').'\):\%(\/\/\)\?\)\S\{-1,}'
|
if lnk !~# '\%(\%('.vimwiki#vars#get_global('schemes_web').'\):\%(\/\/\)\?\)\S\{-1,}'
|
||||||
" prepend file: scheme so link is opened by sytem handler if it isn't a web url
|
" prepend file: scheme so link is opened by system handler if it isn't a web url
|
||||||
let lnk = 'file:'.lnk
|
let lnk = 'file:'.lnk
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -1665,23 +1669,26 @@ function! vimwiki#base#follow_link(split, ...) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if a:split ==# 'hsplit'
|
if a:split ==# 'hsplit'
|
||||||
let cmd = ':split '
|
let cmd = 'split'
|
||||||
elseif a:split ==# 'vsplit'
|
elseif a:split ==# 'vsplit'
|
||||||
let cmd = ':vsplit '
|
let cmd = 'vsplit'
|
||||||
elseif a:split ==# 'badd'
|
elseif a:split ==# 'badd'
|
||||||
let cmd = ':badd '
|
let cmd = 'badd'
|
||||||
elseif a:split ==# 'tab'
|
elseif a:split ==# 'tab'
|
||||||
let cmd = ':tabnew '
|
let cmd = 'tabnew'
|
||||||
elseif a:split ==# 'tabdrop'
|
elseif a:split ==# 'tabdrop'
|
||||||
" Use tab drop if we've already got the file open in an existing tab
|
" Use tab drop if we've already got the file open in an existing tab
|
||||||
let cmd = ':tab drop '
|
let cmd = 'tab edit'
|
||||||
|
if exists(':drop') == 2
|
||||||
|
let cmd = 'tab drop'
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
" Same as above - doing this by default reduces incidence of multiple
|
" Same as above - doing this by default reduces incidence of multiple
|
||||||
" tabs with the same file. We default to :e just in case :drop doesn't
|
" tabs with the same file. We default to :e just in case :drop doesn't
|
||||||
" exist in the current build.
|
" exist in the current build.
|
||||||
let cmd = ':e '
|
let cmd = 'edit'
|
||||||
if exists(':drop')
|
if exists(':drop') == 2 && has('windows')
|
||||||
let cmd = ':drop '
|
let cmd = 'drop'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1691,7 +1698,7 @@ function! vimwiki#base#follow_link(split, ...) abort
|
|||||||
let previous_window_nr = winnr('#')
|
let previous_window_nr = winnr('#')
|
||||||
if previous_window_nr > 0 && previous_window_nr != winnr()
|
if previous_window_nr > 0 && previous_window_nr != winnr()
|
||||||
execute previous_window_nr . 'wincmd w'
|
execute previous_window_nr . 'wincmd w'
|
||||||
let cmd = ':e'
|
let cmd = ':edit'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1739,8 +1746,14 @@ function! vimwiki#base#go_back_link() abort
|
|||||||
" Jump to target with edit_file
|
" Jump to target with edit_file
|
||||||
if !empty(prev_link)
|
if !empty(prev_link)
|
||||||
" go back to saved wiki link
|
" go back to saved wiki link
|
||||||
call vimwiki#base#edit_file(':e ', prev_link[0], '')
|
" Change file if required lazy
|
||||||
call setpos('.', prev_link[1])
|
let file = prev_link[0]
|
||||||
|
let pos = prev_link[1]
|
||||||
|
" Removed the filereadable check for Vader
|
||||||
|
if !(vimwiki#path#is_equal(file, expand('%:p')))
|
||||||
|
call vimwiki#base#edit_file('edit', file, '')
|
||||||
|
endif
|
||||||
|
call setpos('.', pos)
|
||||||
else
|
else
|
||||||
" maybe we came here by jumping to a tag -> pop from the tag stack
|
" maybe we came here by jumping to a tag -> pop from the tag stack
|
||||||
silent! pop!
|
silent! pop!
|
||||||
@@ -1955,7 +1968,7 @@ function! vimwiki#base#rename_file(...) abort
|
|||||||
else
|
else
|
||||||
" Should not happen
|
" Should not happen
|
||||||
call vimwiki#u#error('New buffer is the same as old, so will not delete: '
|
call vimwiki#u#error('New buffer is the same as old, so will not delete: '
|
||||||
\ . buf_new_nb . '.Please open an issue if see this messsage')
|
\ . buf_new_nb . '.Please open an issue if see this message')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Log success
|
" Log success
|
||||||
@@ -2492,7 +2505,7 @@ function! vimwiki#base#table_of_contents(create) abort
|
|||||||
" copy all local variables into dict (add a: if arguments are needed)
|
" copy all local variables into dict (add a: if arguments are needed)
|
||||||
let GeneratorTOC = copy(l:)
|
let GeneratorTOC = copy(l:)
|
||||||
function! GeneratorTOC.f() abort
|
function! GeneratorTOC.f() abort
|
||||||
" Clean heading informations
|
" Clean heading information
|
||||||
let numbering = vimwiki#vars#get_global('html_header_numbering')
|
let numbering = vimwiki#vars#get_global('html_header_numbering')
|
||||||
" TODO numbering not used !
|
" TODO numbering not used !
|
||||||
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
|
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
|
||||||
@@ -2655,7 +2668,7 @@ function! vimwiki#base#normalize_link_helper(str, rxUrl, rxDesc, template) abort
|
|||||||
let descr = s:clean_url(url)
|
let descr = s:clean_url(url)
|
||||||
if descr ==# '' | return url | endif
|
if descr ==# '' | return url | endif
|
||||||
endif
|
endif
|
||||||
" Substiture placeholders
|
" Substitute placeholders
|
||||||
let lnk = s:safesubstitute(a:template, '__LinkDescription__', descr, '')
|
let lnk = s:safesubstitute(a:template, '__LinkDescription__', descr, '')
|
||||||
let lnk = s:safesubstitute(lnk, '__LinkUrl__', url, '')
|
let lnk = s:safesubstitute(lnk, '__LinkUrl__', url, '')
|
||||||
let file_extension = vimwiki#vars#get_wikilocal('ext', vimwiki#vars#get_bufferlocal('wiki_nr'))
|
let file_extension = vimwiki#vars#get_wikilocal('ext', vimwiki#vars#get_bufferlocal('wiki_nr'))
|
||||||
@@ -2833,7 +2846,7 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! vimwiki#base#complete_file(ArgLead, CmdLine, CursorPos) abort
|
function! vimwiki#base#complete_file(ArgLead, CmdLine, CursorPos) abort
|
||||||
" Complete filename relatie to current file
|
" Complete filename relative to current file
|
||||||
" Called: rename_file
|
" Called: rename_file
|
||||||
" Start from current file
|
" Start from current file
|
||||||
let base_path = expand('%:h')
|
let base_path = expand('%:h')
|
||||||
@@ -2900,7 +2913,7 @@ function! s:get_title(match) abort
|
|||||||
" Do not overwrite if g:page_title is already set
|
" Do not overwrite if g:page_title is already set
|
||||||
" when there are multiple <title> tags, only use the first one
|
" when there are multiple <title> tags, only use the first one
|
||||||
" this is a side effect of the substitute's 'n' flag (count number of
|
" this is a side effect of the substitute's 'n' flag (count number of
|
||||||
" occurences and evaluate \= for each one
|
" occurrences and evaluate \= for each one
|
||||||
if (g:page_title !=# '')
|
if (g:page_title !=# '')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@@ -3005,7 +3018,7 @@ function! vimwiki#base#colorize(...) range abort
|
|||||||
" TODO Must be coherent with color_tag_template
|
" TODO Must be coherent with color_tag_template
|
||||||
" Arg1: Key, list them with VimwikiColorize completion
|
" Arg1: Key, list them with VimwikiColorize completion
|
||||||
" Arg2: visualmode()
|
" Arg2: visualmode()
|
||||||
" -- Just removeing spaces, \/ -> /, replacing COLORFG will do it
|
" -- Just removing spaces, \/ -> /, replacing COLORFG will do it
|
||||||
let key = a:0 ? a:1 : 'default'
|
let key = a:0 ? a:1 : 'default'
|
||||||
let mode = a:0 > 1 ? a:2 : ''
|
let mode = a:0 > 1 ? a:2 : ''
|
||||||
let color_dic = vimwiki#vars#get_wikilocal('color_dic')
|
let color_dic = vimwiki#vars#get_wikilocal('color_dic')
|
||||||
|
|||||||
+13
-10
@@ -184,7 +184,7 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! s:read_captions(files) abort
|
function! s:read_captions(files) abort
|
||||||
" Read all cpation in 1. <List>files
|
" Read all caption in 1. <List>files
|
||||||
" Return: <Dic>: key -> caption
|
" Return: <Dic>: key -> caption
|
||||||
let result = {}
|
let result = {}
|
||||||
let caption_level = vimwiki#vars#get_wikilocal('diary_caption_level')
|
let caption_level = vimwiki#vars#get_wikilocal('diary_caption_level')
|
||||||
@@ -299,20 +299,23 @@ function! vimwiki#diary#make_note(wnum, ...) abort
|
|||||||
call vimwiki#path#mkdir(vimwiki#vars#get_wikilocal('path', wiki_nr).
|
call vimwiki#path#mkdir(vimwiki#vars#get_wikilocal('path', wiki_nr).
|
||||||
\ vimwiki#vars#get_wikilocal('diary_rel_path', wiki_nr))
|
\ vimwiki#vars#get_wikilocal('diary_rel_path', wiki_nr))
|
||||||
|
|
||||||
let cmd = 'edit'
|
let cmd = ':edit'
|
||||||
if a:0
|
if a:0
|
||||||
if a:1 == 1
|
if a:1 == 1
|
||||||
let cmd = 'tabedit'
|
let cmd = ':tabedit'
|
||||||
elseif a:1 == 2
|
elseif a:1 == 2
|
||||||
let cmd = 'split'
|
let cmd = ':split'
|
||||||
elseif a:1 == 3
|
elseif a:1 == 3
|
||||||
let cmd = 'vsplit'
|
let cmd = ':vsplit'
|
||||||
elseif a:1 == 4
|
elseif a:1 == 4
|
||||||
let cmd = 'tab drop'
|
let cmd = ':tab edit'
|
||||||
|
if exists(':drop') == 2
|
||||||
|
let cmd = ':tab drop'
|
||||||
|
endif
|
||||||
elseif a:1 == 5
|
elseif a:1 == 5
|
||||||
let cmd = 'drop'
|
let cmd = ':edit'
|
||||||
if exists(':drop')
|
if exists(':drop') == 2
|
||||||
let cmd = 'drop'
|
let cmd = ':drop'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -449,7 +452,7 @@ function! vimwiki#diary#generate_diary_section() abort
|
|||||||
let extension = vimwiki#vars#get_wikilocal('ext', wiki_nr)
|
let extension = vimwiki#vars#get_wikilocal('ext', wiki_nr)
|
||||||
let entry = substitute(entry, '__FileExtension__', extension, 'g')
|
let entry = substitute(entry, '__FileExtension__', extension, 'g')
|
||||||
" If single H1 then that will be used as the description for the link to the file
|
" If single H1 then that will be used as the description for the link to the file
|
||||||
" if multple H1 then the filename will be used as the description for the link to the
|
" if multiple H1 then the filename will be used as the description for the link to the
|
||||||
" file and multiple H1 headers will be indented by shiftwidth
|
" file and multiple H1 headers will be indented by shiftwidth
|
||||||
call add(lines, repeat(' ', vimwiki#lst#get_list_margin()).bullet.entry)
|
call add(lines, repeat(' ', vimwiki#lst#get_list_margin()).bullet.entry)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ endif
|
|||||||
let g:loaded_vimwiki_html_auto = 1
|
let g:loaded_vimwiki_html_auto = 1
|
||||||
|
|
||||||
" FIXME: Magics: Why not use the current syntax highlight
|
" FIXME: Magics: Why not use the current syntax highlight
|
||||||
" This is due to historical copy paste and lazyness of markdown user
|
" This is due to historical copy paste and laziness of markdown user
|
||||||
" text: *strong*
|
" text: *strong*
|
||||||
" let s:default_syntax.rxBold = '\*[^*]\+\*'
|
" let s:default_syntax.rxBold = '\*[^*]\+\*'
|
||||||
let s:rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
let s:rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
||||||
@@ -1081,7 +1081,7 @@ function! s:process_tag_list(line, lists, lstLeadingSpaces) abort
|
|||||||
return [processed, lines, lstLeadingSpaces]
|
return [processed, lines, lstLeadingSpaces]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Can embeded indented code in list (Issue #55)
|
" Can embedded indented code in list (Issue #55)
|
||||||
let b_permit = in_list
|
let b_permit = in_list
|
||||||
let blockquoteRegExp = '^\s\{' . (lstLeadingSpaces + 2) . ',}[^[:space:]>*-]'
|
let blockquoteRegExp = '^\s\{' . (lstLeadingSpaces + 2) . ',}[^[:space:]>*-]'
|
||||||
let b_match = lstSym ==# '' && a:line =~# blockquoteRegExp
|
let b_match = lstSym ==# '' && a:line =~# blockquoteRegExp
|
||||||
@@ -1884,26 +1884,26 @@ function! s:convert_file(path_html, wikifile) abort
|
|||||||
endif
|
endif
|
||||||
call vimwiki#path#mkdir(path_html)
|
call vimwiki#path#mkdir(path_html)
|
||||||
|
|
||||||
if g:vimwiki_global_vars['listing_hl'] > 0 && has("unix")
|
if g:vimwiki_global_vars['listing_hl'] > 0 && has('unix')
|
||||||
let i = 0
|
let i = 0
|
||||||
while i < len(html_lines)
|
while i < len(html_lines)
|
||||||
if html_lines[i] =~ '^<pre .*type=.\+>'
|
if html_lines[i] =~# '^<pre .*type=.\+>'
|
||||||
let type = split(split(split(html_lines[i], 'type=')[1], '>')[0], '\s\+')[0]
|
let type = split(split(split(html_lines[i], 'type=')[1], '>')[0], '\s\+')[0]
|
||||||
let attr = split(split(html_lines[i], '<pre ')[0], '>')[0]
|
let attr = split(split(html_lines[i], '<pre ')[0], '>')[0]
|
||||||
let start = i + 1
|
let start = i + 1
|
||||||
let cur = start
|
let cur = start
|
||||||
|
|
||||||
while html_lines[cur] !~ '^<\/pre>'
|
while html_lines[cur] !~# '^<\/pre>'
|
||||||
let cur += 1
|
let cur += 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
let tmp = ('tmp'. split(system('mktemp -p . --suffix=.' . type, 'silent'), 'tmp')[-1])[:-2]
|
let tmp = ('tmp'. split(system('mktemp -p . --suffix=.' . type, 'silent'), 'tmp')[-1])[:-2]
|
||||||
call system('echo ' . shellescape(join(html_lines[start:cur - 1], '\n')) . ' > ' . tmp)
|
call system('echo ' . shellescape(join(html_lines[start : cur - 1], '\n')) . ' > ' . tmp)
|
||||||
call system(g:vimwiki_global_vars['listing_hl_command'] . ' ' . tmp . ' > ' . tmp . '.html')
|
call system(g:vimwiki_global_vars['listing_hl_command'] . ' ' . tmp . ' > ' . tmp . '.html')
|
||||||
let html_out = system('cat ' . tmp . '.html')
|
let html_out = system('cat ' . tmp . '.html')
|
||||||
call system('rm ' . tmp . ' ' . tmp . '.html')
|
call system('rm ' . tmp . ' ' . tmp . '.html')
|
||||||
let i = cur
|
let i = cur
|
||||||
let html_lines = html_lines[0:start - 1] + split(html_out, '\n') + html_lines[cur:]
|
let html_lines = html_lines[0 : start - 1] + split(html_out, '\n') + html_lines[cur : ]
|
||||||
endif
|
endif
|
||||||
let i += 1
|
let i += 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function! s:windowsify(path) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" Define: os specific path convertion
|
" Define: os specific path conversion
|
||||||
if vimwiki#u#is_windows()
|
if vimwiki#u#is_windows()
|
||||||
function! s:osxify(path) abort
|
function! s:osxify(path) abort
|
||||||
return s:windowsify(a:path)
|
return s:windowsify(a:path)
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ function! s:tags_entry_cmp(i1, i2) abort
|
|||||||
"
|
"
|
||||||
" This function is needed for tags sorting, since plain sort() compares line
|
" This function is needed for tags sorting, since plain sort() compares line
|
||||||
" numbers as strings, not integers, and so, for example, tag at line 14
|
" numbers as strings, not integers, and so, for example, tag at line 14
|
||||||
" preceeds the same tag on the same page at line 9. (Because string "14" is
|
" precedes the same tags on the same page at line 9. (Because string "14" is
|
||||||
" alphabetically 'less than' string "9".)
|
" alphabetically 'less than' string "9".)
|
||||||
let items = []
|
let items = []
|
||||||
for orig_item in [a:i1, a:i2]
|
for orig_item in [a:i1, a:i2]
|
||||||
|
|||||||
+53
-14
@@ -53,9 +53,9 @@ function! vimwiki#u#deprecate(old, new) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! vimwiki#u#get_selection(...) abort
|
function! vimwiki#u#get_selection(...) abort
|
||||||
" Get visual selection text content, optionaly replace its content
|
" Get visual selection text content, optionally replace its content
|
||||||
" :param: Text to replace selection
|
" :param: Text to replace selection
|
||||||
" Copyed from DarkWiiPlayer at stackoverflow
|
" Copied from DarkWiiPlayer at stackoverflow
|
||||||
" https://stackoverflow.com/a/47051271/2544873
|
" https://stackoverflow.com/a/47051271/2544873
|
||||||
" Get selection extremity position,
|
" Get selection extremity position,
|
||||||
" Discriminate selection mode
|
" Discriminate selection mode
|
||||||
@@ -271,7 +271,7 @@ endfunction
|
|||||||
|
|
||||||
function! vimwiki#u#get_syntax_dic(...) abort
|
function! vimwiki#u#get_syntax_dic(...) abort
|
||||||
" Helper: Getter
|
" Helper: Getter
|
||||||
" :param: syntax <string> to retrive, default to current
|
" :param: syntax <string> to retrieve, default to current
|
||||||
let syntax = a:0 ? a:1 : vimwiki#vars#get_wikilocal('syntax')
|
let syntax = a:0 ? a:1 : vimwiki#vars#get_wikilocal('syntax')
|
||||||
return g:vimwiki_syntaxlocal_vars[syntax]
|
return g:vimwiki_syntaxlocal_vars[syntax]
|
||||||
endfunction
|
endfunction
|
||||||
@@ -304,18 +304,55 @@ function! vimwiki#u#hi_expand_regex(lst) abort
|
|||||||
" :param: list<list,delimiters>> with reduced regex
|
" :param: list<list,delimiters>> with reduced regex
|
||||||
" Return: list with extended regex delimiters (not inside a word)
|
" Return: list with extended regex delimiters (not inside a word)
|
||||||
" -- [['\*_', '_\*']] -> [['\*_\S\@=', '\S\@<=_\*\%(\s\|$\)\@=']]
|
" -- [['\*_', '_\*']] -> [['\*_\S\@=', '\S\@<=_\*\%(\s\|$\)\@=']]
|
||||||
|
" Note: For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.
|
||||||
" See: https://github.github.com/gfm/#left-flanking-delimiter-run
|
" See: https://github.github.com/gfm/#left-flanking-delimiter-run
|
||||||
let res = []
|
let res = []
|
||||||
let p = vimwiki#u#get_punctuation_string()
|
let punctuation = vimwiki#u#get_punctuation_string()
|
||||||
for delimiters in a:lst
|
|
||||||
let r_prefix = '\(^\|[[:space:]]\@<=\)'
|
" Iterate on (left delimiter, right delimiter pair)
|
||||||
" Regex Start: not preceded by backslash, not ended by space
|
for a_delimiter in a:lst
|
||||||
let r_start = r_prefix . delimiters[0] . '\S\@='
|
let r_left_del = a_delimiter[0]
|
||||||
" Regex End: not preceded by backslash or space, ended by punctuation or space
|
let r_right_del = a_delimiter[1]
|
||||||
let r_prefix = '\(^\|[^[:space:]\\]\@<=\)'
|
|
||||||
let r_end = r_prefix . delimiters[1] . '\%(\_[[:space:]' . p . ']\)\@='
|
" Regex Start:
|
||||||
|
" Left-Flanking is not followed by space (or need of line)
|
||||||
|
let r_left_prefix = '\%(^\|[[:space:]]\@<=\)'
|
||||||
|
let r_left_prefix = '\\\@<!'
|
||||||
|
" -- not followed by Unicode whitespace,
|
||||||
|
let r_left_suffix = '\%([^[:space:]]\@=\)'
|
||||||
|
|
||||||
|
" Left Case1: not followed by punctuation
|
||||||
|
let r_left_suffix1 = '\%(\%([^[:space:]' . punctuation . ']\)\@=\)'
|
||||||
|
" -- Can escape the leftflank
|
||||||
|
let r_left_prefix1 = '\%(^\|\\\@<!\)'
|
||||||
|
|
||||||
|
" Left Case2: followed by punctuation so must be preceded by Unicode whitespace or start of line or a punctuation character.
|
||||||
|
let r_left_suffix2 = '\%([' . punctuation . ']\@=\)'
|
||||||
|
let r_left_prefix2 = '\%(\%(^\|[[:space:]' . punctuation . ']\)\@<=\)'
|
||||||
|
|
||||||
|
" Left Concatenate
|
||||||
|
let r_start = '\%(' . r_left_prefix1 . r_left_del . r_left_suffix1
|
||||||
|
let r_start .= '\|' . r_left_prefix2 . r_left_del . r_left_suffix2 . '\)'
|
||||||
|
|
||||||
|
" Regex End:
|
||||||
|
" not preceded by Unicode whitespace
|
||||||
|
let r_right_prefix = '\(^\|[^[:space:]]\@<=\)'
|
||||||
|
|
||||||
|
" Right Case1: not preceded by a punctuation character (or start of line)
|
||||||
|
let r_right_prefix1 = '\%(\%(^\|[^[:space:]' . punctuation . ']\)\@<=\)'
|
||||||
|
let r_right_suffix1 = ''
|
||||||
|
|
||||||
|
" Right Case2: preceded by a punctuation character and followed by Unicode whitespace or end of line or a punctuation character
|
||||||
|
let r_right_prefix2 = '\%([' . punctuation . ']\@<=\)'
|
||||||
|
let r_right_suffix2 = '\%(\%($\|[[:space:]' . punctuation . ']\)\@<=\)'
|
||||||
|
|
||||||
|
" Right Concatenate
|
||||||
|
let r_end = '\%(' . r_right_prefix1 . r_right_del . r_right_suffix1
|
||||||
|
let r_end .= '\|' . r_right_prefix2 . r_right_del . r_right_suffix2 . '\)'
|
||||||
|
|
||||||
call add(res, [r_start, r_end])
|
call add(res, [r_start, r_end])
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return res
|
return res
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -337,9 +374,9 @@ function! vimwiki#u#hi_tag(tag_pre, tag_post, syntax_group, contains, ...) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Craft command
|
" Craft command
|
||||||
|
" \ 'skip="\\' . a:tag_pre . '" ' .
|
||||||
let cmd = 'syn region ' . a:syntax_group . ' matchgroup=VimwikiDelimiter ' .
|
let cmd = 'syn region ' . a:syntax_group . ' matchgroup=VimwikiDelimiter ' .
|
||||||
\ opt_is_contained .
|
\ opt_is_contained .
|
||||||
\ 'skip="\\' . a:tag_pre . '" ' .
|
|
||||||
\ 'start="' . a:tag_pre . '" ' .
|
\ 'start="' . a:tag_pre . '" ' .
|
||||||
\ 'end="' . a:tag_post . '" ' .
|
\ 'end="' . a:tag_post . '" ' .
|
||||||
\ 'keepend ' .
|
\ 'keepend ' .
|
||||||
@@ -361,7 +398,7 @@ function! vimwiki#u#hi_typeface(dic) abort
|
|||||||
" The last syntax defined take precedence so that user can change at runtime (:h :syn-define)
|
" The last syntax defined take precedence so that user can change at runtime (:h :syn-define)
|
||||||
" Some cases are contained by default:
|
" Some cases are contained by default:
|
||||||
" -- ex: VimwikiCodeBoldUnderline is not defined in colorschemes -> VimwikiCode
|
" -- ex: VimwikiCodeBoldUnderline is not defined in colorschemes -> VimwikiCode
|
||||||
" -- see: #709 asking for concealing quotes in bold, so it must be higlighted differently
|
" -- see: #709 asking for concealing quotes in bold, so it must be highlighted differently
|
||||||
" -- -- for the user to understand what is concealed around
|
" -- -- for the user to understand what is concealed around
|
||||||
" VimwikiCheckBoxDone and VimwikiDelText are as their are even when nested in bold or italic
|
" VimwikiCheckBoxDone and VimwikiDelText are as their are even when nested in bold or italic
|
||||||
" -- This is because it would add a lot of code (as n**2) at startup and is not often used
|
" -- This is because it would add a lot of code (as n**2) at startup and is not often used
|
||||||
@@ -442,5 +479,7 @@ function! vimwiki#u#hi_typeface(dic) abort
|
|||||||
|
|
||||||
" Prevent var_with_underscore to trigger italic text
|
" Prevent var_with_underscore to trigger italic text
|
||||||
" -- See $VIMRUNTIME/syntax/markdown.vim
|
" -- See $VIMRUNTIME/syntax/markdown.vim
|
||||||
syn match VimwikiError "\w\@<=[_*]\w\@="
|
" But leave
|
||||||
|
" -- See https://github.github.com/gfm/#example-364
|
||||||
|
syn match VimwikiError "\w\@<=_\w\@="
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ endfunction
|
|||||||
function! s:check_users_value(key, users_value, value_infos, comes_from_global_variable) abort
|
function! s:check_users_value(key, users_value, value_infos, comes_from_global_variable) abort
|
||||||
" Helper: Check user setting
|
" Helper: Check user setting
|
||||||
" warn user with message if not good type
|
" warn user with message if not good type
|
||||||
" Param: 1: key <string>: varaible name
|
" Param: 1: key <string>: variable name
|
||||||
" Param: 2: vimwiki_key <obj>: user value
|
" Param: 2: vimwiki_key <obj>: user value
|
||||||
" Param: 3: value_infod <dict>: type and default value
|
" Param: 3: value_infod <dict>: type and default value
|
||||||
" Param: 4: coming from a global variable <bool>
|
" Param: 4: coming from a global variable <bool>
|
||||||
@@ -755,9 +755,9 @@ function! s:get_markdown_syntaxlocal() abort
|
|||||||
\ 'underline': vimwiki#u#hi_expand_regex([]),
|
\ 'underline': vimwiki#u#hi_expand_regex([]),
|
||||||
\ 'bold_italic': vimwiki#u#hi_expand_regex([['\*_', '_\*'], ['_\*', '\*_'], ['\*\*\*', '\*\*\*'], ['___', '___']]),
|
\ 'bold_italic': vimwiki#u#hi_expand_regex([['\*_', '_\*'], ['_\*', '\*_'], ['\*\*\*', '\*\*\*'], ['___', '___']]),
|
||||||
\ 'code': [
|
\ 'code': [
|
||||||
\ ['\%(^\|[^`]\)\@<=`\%($\|[^`]\)\@=',
|
\ ['\%(^\|[^`\\]\)\@<=`\%($\|[^`]\)\@=',
|
||||||
\ '\%(^\|[^`]\)\@<=`\%($\|[^`]\)\@='],
|
\ '\%(^\|[^`]\)\@<=`\%($\|[^`]\)\@='],
|
||||||
\ ['\%(^\|[^`]\)\@<=``\%($\|[^`]\)\@=',
|
\ ['\%(^\|[^`\\]\)\@<=``\%($\|[^`]\)\@=',
|
||||||
\ '\%(^\|[^`]\)\@<=``\%($\|[^`]\)\@='],
|
\ '\%(^\|[^`]\)\@<=``\%($\|[^`]\)\@='],
|
||||||
\ ],
|
\ ],
|
||||||
\ 'del': [['\~\~', '\~\~']],
|
\ 'del': [['\~\~', '\~\~']],
|
||||||
@@ -857,7 +857,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
|
|||||||
call s:extend_local(syntax_dic, default_dic, syntax_dic, g:vimwiki_syntax_list[a:syntax])
|
call s:extend_local(syntax_dic, default_dic, syntax_dic, g:vimwiki_syntax_list[a:syntax])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" TODO make that clean (i.e clearify what is local to syntax ot to buffer)
|
" TODO make that clean (i.e clarify what is local to syntax or to buffer)
|
||||||
" Get from local vars
|
" Get from local vars
|
||||||
let bullet_types = vimwiki#vars#get_wikilocal('bullet_types')
|
let bullet_types = vimwiki#vars#get_wikilocal('bullet_types')
|
||||||
if !empty(bullet_types)
|
if !empty(bullet_types)
|
||||||
@@ -927,7 +927,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
|
|||||||
\ '^\s*\('.header_symbol.'\{1,6}\)\zs[^'.header_symbol.'].*[^'.header_symbol.']\ze\1\s*$'
|
\ '^\s*\('.header_symbol.'\{1,6}\)\zs[^'.header_symbol.'].*[^'.header_symbol.']\ze\1\s*$'
|
||||||
else
|
else
|
||||||
" asymmetric
|
" asymmetric
|
||||||
" Note: For markdown rxH=# and asymetric
|
" Note: For markdown rxH=# and asymmetric
|
||||||
for i in range(1,6)
|
for i in range(1,6)
|
||||||
let syntax_dic['rxH'.i.'_Template'] =
|
let syntax_dic['rxH'.i.'_Template'] =
|
||||||
\ repeat(header_symbol, i).' __Header__'
|
\ repeat(header_symbol, i).' __Header__'
|
||||||
@@ -941,7 +941,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
|
|||||||
\ '^\s*'.header_symbol.'\{1,'.i.'}[^'.header_symbol.'].*$\|\%$'
|
\ '^\s*'.header_symbol.'\{1,'.i.'}[^'.header_symbol.'].*$\|\%$'
|
||||||
endfor
|
endfor
|
||||||
" Define header regex
|
" Define header regex
|
||||||
" -- ATX heading := preceed by #*
|
" -- ATX heading := preceded by #*
|
||||||
let atx_heading = '^\s*\%('.header_symbol.'\{1,6}\)'
|
let atx_heading = '^\s*\%('.header_symbol.'\{1,6}\)'
|
||||||
let atx_heading .= '\zs[^'.header_symbol.'].*\ze$'
|
let atx_heading .= '\zs[^'.header_symbol.'].*\ze$'
|
||||||
let syntax_dic.rxHeader = atx_heading
|
let syntax_dic.rxHeader = atx_heading
|
||||||
|
|||||||
+4
-4
@@ -53,7 +53,7 @@ random edit.
|
|||||||
|
|
||||||
The lowest row gets aligned when leaving the Insert mode. Let's copy _Data1_
|
The lowest row gets aligned when leaving the Insert mode. Let's copy _Data1_
|
||||||
(using `viwy` or another keystroke) and paste it (using `p`) in the second data
|
(using `viwy` or another keystroke) and paste it (using `p`) in the second data
|
||||||
row of the first column. Now the table looks mis-aligned (as we did not enter
|
row of the first column. Now the table looks misaligned (as we did not enter
|
||||||
the Insert mode).
|
the Insert mode).
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -123,7 +123,7 @@ Let's take the table from the previous example in an intermediate state.
|
|||||||
```
|
```
|
||||||
|
|
||||||
Then move the cursor to the first data row, copy it with `yy`, go down to the
|
Then move the cursor to the first data row, copy it with `yy`, go down to the
|
||||||
mis-aligned line, and press `5p`. Now we have a slightly bigger mis-aligned
|
misaligned line, and press `5p`. Now we have a slightly bigger misaligned
|
||||||
table.
|
table.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -178,8 +178,8 @@ row by row from the top to the bottom, dynamic formatting should be both fast
|
|||||||
(watching only three rows in a table, re-formatting only when the shrunk
|
(watching only three rows in a table, re-formatting only when the shrunk
|
||||||
current row gets longer than any of the two rows above) and eager (a table
|
current row gets longer than any of the two rows above) and eager (a table
|
||||||
should look formatted on every press on _Tab_ and _Enter_). However, the newer
|
should look formatted on every press on _Tab_ and _Enter_). However, the newer
|
||||||
algorithm differs from the older algorithm when starting editing a mis-aligned
|
algorithm differs from the older algorithm when starting editing a misaligned
|
||||||
table in an area where mis-aligned rows do not get into the viewport: in this
|
table in an area where misaligned rows do not get into the viewport: in this
|
||||||
case the newer algorithm will format the table partly (in the rows of the
|
case the newer algorithm will format the table partly (in the rows of the
|
||||||
viewport) until one of the being edited cells grows in length to a value big
|
viewport) until one of the being edited cells grows in length to a value big
|
||||||
enough to trigger the older algorithm and the whole table gets aligned. When
|
enough to trigger the older algorithm and the whole table gets aligned. When
|
||||||
|
|||||||
+10
-10
@@ -1426,7 +1426,7 @@ Use {{{ and }}} to define a block of preformatted text:
|
|||||||
In what distant deeps or skies
|
In what distant deeps or skies
|
||||||
Burnt the fire of thine eyes?
|
Burnt the fire of thine eyes?
|
||||||
On what wings dare he aspire?
|
On what wings dare he aspire?
|
||||||
What the hand dare sieze the fire?
|
What the hand dare seize the fire?
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
|
||||||
@@ -2695,7 +2695,7 @@ Key Default value~
|
|||||||
cycle_bullets 0
|
cycle_bullets 0
|
||||||
|
|
||||||
If set to 1 (true), cycle through |bullet_types| when changing list element
|
If set to 1 (true), cycle through |bullet_types| when changing list element
|
||||||
identation
|
indentation
|
||||||
|
|
||||||
|
|
||||||
*vimwiki-option-generated_links_caption*
|
*vimwiki-option-generated_links_caption*
|
||||||
@@ -2703,7 +2703,7 @@ identation
|
|||||||
Key Default value~
|
Key Default value~
|
||||||
generated_links_caption 0
|
generated_links_caption 0
|
||||||
|
|
||||||
Default syntax only. If set to 1 (true), use the [[URL|DESCRIPTIOM]] when
|
Default syntax only. If set to 1 (true), use the [[URL|DESCRIPTION]] when
|
||||||
calling |:VimwikiGenerateLinks|. DESCRIPTION will be the first header in the
|
calling |:VimwikiGenerateLinks|. DESCRIPTION will be the first header in the
|
||||||
corresbonding file found in the first n lines, where n is set by
|
corresbonding file found in the first n lines, where n is set by
|
||||||
|g:vimwiki_max_scan_for_caption| (Default 5). If no caption is found fallback
|
|g:vimwiki_max_scan_for_caption| (Default 5). If no caption is found fallback
|
||||||
@@ -3291,8 +3291,8 @@ small screens. If |g:vimwiki_table_auto_fmt| is set to 0, this option has no
|
|||||||
effect.
|
effect.
|
||||||
|
|
||||||
Value Description~
|
Value Description~
|
||||||
0 Enable table auto formating for all columns.
|
0 Enable table auto formatting for all columns.
|
||||||
1 Disable table auto formating for the last column.
|
1 Disable table auto formatting for the last column.
|
||||||
|
|
||||||
Default: 0
|
Default: 0
|
||||||
|
|
||||||
@@ -3778,7 +3778,7 @@ The default is %%%s.
|
|||||||
|
|
||||||
Bitfield: Enable/disable emoji conceal and complete
|
Bitfield: Enable/disable emoji conceal and complete
|
||||||
Note that the |completefunc| is only set if it does not exists already to keep
|
Note that the |completefunc| is only set if it does not exists already to keep
|
||||||
other plugin works by default. It can be set it manualy with: >
|
other plugin works by default. It can be set it manually with: >
|
||||||
set completefunc=vimwiki#emoji#complete
|
set completefunc=vimwiki#emoji#complete
|
||||||
|
|
||||||
To replace emoji alias (like :cat:) by their value (like 🐱) in current file: >
|
To replace emoji alias (like :cat:) by their value (like 🐱) in current file: >
|
||||||
@@ -4090,10 +4090,10 @@ Fixed:~
|
|||||||
* Issue #894: Make all appropriate settings wikilocal (many commits)
|
* Issue #894: Make all appropriate settings wikilocal (many commits)
|
||||||
* PR #902: Doc: Darken logo text
|
* PR #902: Doc: Darken logo text
|
||||||
* PR #895: Fix: File extension for markdown -> syntax wide
|
* PR #895: Fix: File extension for markdown -> syntax wide
|
||||||
__FileExtention__ keyword appears
|
__FileExtension__ keyword appears
|
||||||
* PR #963: Doc: Replace VimwikiListChangeLevel references in doc with
|
* PR #963: Doc: Replace VimwikiListChangeLevel references in doc with
|
||||||
VimwikiListChangeLvl as defined by command
|
VimwikiListChangeLvl as defined by command
|
||||||
* PR #900: conceallevel is now setted locally for vimwiki buffers
|
* PR #900: conceallevel is now set locally for vimwiki buffers
|
||||||
* Issue #942: Fixing wrong html link conversion in windows
|
* Issue #942: Fixing wrong html link conversion in windows
|
||||||
* PR #919: Fix duplicate helptag
|
* PR #919: Fix duplicate helptag
|
||||||
* PR #959: Fix :VimwikiNextTask
|
* PR #959: Fix :VimwikiNextTask
|
||||||
@@ -4151,7 +4151,7 @@ New:~
|
|||||||
sections. New option |g:vimwiki_links_header_level| and
|
sections. New option |g:vimwiki_links_header_level| and
|
||||||
|g:vimwiki_tags_header_level| which allow the header level (1-6) of the
|
|g:vimwiki_tags_header_level| which allow the header level (1-6) of the
|
||||||
generated links to be set. New option |g:vimwiki_markdown_header_style|
|
generated links to be set. New option |g:vimwiki_markdown_header_style|
|
||||||
which specifies the nuber of newlines after the created header for
|
which specifies the number of newlines after the created header for
|
||||||
generated sections.
|
generated sections.
|
||||||
* PR #635: Wiki local options |vimwiki-option-auto_generate_links| and
|
* PR #635: Wiki local options |vimwiki-option-auto_generate_links| and
|
||||||
|vimwiki-option-auto_generate_tags|.
|
|vimwiki-option-auto_generate_tags|.
|
||||||
@@ -4198,7 +4198,7 @@ Fixed:~
|
|||||||
* Issue #90: |:VimwikiRenameFile| doesn't update links in diary.
|
* Issue #90: |:VimwikiRenameFile| doesn't update links in diary.
|
||||||
* Issue #790: Allow tags before a header with markdown syntax.
|
* Issue #790: Allow tags before a header with markdown syntax.
|
||||||
* Issue #779: Vimwiki tags file meets ctags standard.
|
* Issue #779: Vimwiki tags file meets ctags standard.
|
||||||
* Issue #781: Compatablity fixes for older versions of Vim.
|
* Issue #781: Compatibility fixes for older versions of Vim.
|
||||||
* Issue #691: Allow |:VimwikiGoBackLink| to go back multiple times.
|
* Issue #691: Allow |:VimwikiGoBackLink| to go back multiple times.
|
||||||
* Update MathJax CDN loading instructions.
|
* Update MathJax CDN loading instructions.
|
||||||
* Issue #212: Don't treat comment characters within code blocks as
|
* Issue #212: Don't treat comment characters within code blocks as
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
" Home: https://github.com/vimwiki/vimwiki/
|
" Home: https://github.com/vimwiki/vimwiki/
|
||||||
|
|
||||||
|
|
||||||
" Clause: load only onces per buffer
|
" Clause: load only once per buffer
|
||||||
if exists('b:did_ftplugin')
|
if exists('b:did_ftplugin')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@@ -160,7 +160,7 @@ setlocal formatoptions-=2
|
|||||||
setlocal formatoptions+=c
|
setlocal formatoptions+=c
|
||||||
" Do not wrap if line was already long
|
" Do not wrap if line was already long
|
||||||
setlocal formatoptions+=l
|
setlocal formatoptions+=l
|
||||||
" AutoWrap inteligent with lists
|
" AutoWrap intelligent with lists
|
||||||
setlocal formatoptions+=n
|
setlocal formatoptions+=n
|
||||||
let &formatlistpat = vimwiki#vars#get_wikilocal('rxListItem')
|
let &formatlistpat = vimwiki#vars#get_wikilocal('rxListItem')
|
||||||
" Used to join 'commented' lines (blockquote, list) (see: #915)
|
" Used to join 'commented' lines (blockquote, list) (see: #915)
|
||||||
@@ -222,7 +222,7 @@ endfunction
|
|||||||
" (so that -s:tolerance <= spare <= s:tolerance, "string" ends with s:ellipsis)
|
" (so that -s:tolerance <= spare <= s:tolerance, "string" ends with s:ellipsis)
|
||||||
" Return: [string, spare]
|
" Return: [string, spare]
|
||||||
function! s:shorten_text(text, len) abort
|
function! s:shorten_text(text, len) abort
|
||||||
" strlen() returns lenght in bytes, not in characters, so we'll have to do a
|
" strlen() returns length in bytes, not in characters, so we'll have to do a
|
||||||
" trick here -- replace all non-spaces with dot, calculate lengths and
|
" trick here -- replace all non-spaces with dot, calculate lengths and
|
||||||
" indexes on it, then use original string to break at selected index.
|
" indexes on it, then use original string to break at selected index.
|
||||||
let text_pattern = substitute(a:text, '\m\S', '.', 'g')
|
let text_pattern = substitute(a:text, '\m\S', '.', 'g')
|
||||||
@@ -452,8 +452,6 @@ 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')
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
" GetLatestVimScripts: 2226 1 :AutoInstall: vimwiki
|
" GetLatestVimScripts: 2226 1 :AutoInstall: vimwiki
|
||||||
|
|
||||||
|
|
||||||
" Clause: load only onces
|
" Clause: load only once
|
||||||
if exists('g:loaded_vimwiki') || &compatible
|
if exists('g:loaded_vimwiki') || &compatible
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@@ -20,7 +20,7 @@ let s:plugin_dir = expand('<sfile>:p:h:h')
|
|||||||
let s:old_cpo = &cpoptions
|
let s:old_cpo = &cpoptions
|
||||||
set cpoptions&vim
|
set cpoptions&vim
|
||||||
|
|
||||||
" Save autowriteall varaible state
|
" Save autowriteall variable state
|
||||||
if exists('g:vimwiki_autowriteall')
|
if exists('g:vimwiki_autowriteall')
|
||||||
let s:vimwiki_autowriteall_saved = g:vimwiki_autowriteall
|
let s:vimwiki_autowriteall_saved = g:vimwiki_autowriteall
|
||||||
else
|
else
|
||||||
|
|||||||
+3
-3
@@ -24,7 +24,7 @@ call vimwiki#vars#populate_syntax_vars(s:current_syntax)
|
|||||||
let syntax_dic = g:vimwiki_syntaxlocal_vars[s:current_syntax]
|
let syntax_dic = g:vimwiki_syntaxlocal_vars[s:current_syntax]
|
||||||
|
|
||||||
" Declare nesting capabilities
|
" Declare nesting capabilities
|
||||||
" -- to be embeded in standard: bold, italic, underline
|
" -- to be embedded in standard: bold, italic, underline
|
||||||
|
|
||||||
" text: `code` or ``code`` only inline
|
" text: `code` or ``code`` only inline
|
||||||
" Note: `\%(^\|[^`]\)\@<=` means after a new line or a non `
|
" Note: `\%(^\|[^`]\)\@<=` means after a new line or a non `
|
||||||
@@ -316,7 +316,7 @@ for [color_key, color_value] in items(color_dic)
|
|||||||
\ . ' ' . b:vimwiki_syntax_concealends
|
\ . ' ' . b:vimwiki_syntax_concealends
|
||||||
execute cmd
|
execute cmd
|
||||||
|
|
||||||
" Build hightlight command
|
" Build highlight command
|
||||||
let cmd = 'hi Vimwiki' . color_key
|
let cmd = 'hi Vimwiki' . color_key
|
||||||
if fg !=# ''
|
if fg !=# ''
|
||||||
let cmd .= ' guifg=' . fg
|
let cmd .= ' guifg=' . fg
|
||||||
@@ -471,7 +471,7 @@ hi def link VimwikiSubScriptChar VimwikiMarkers
|
|||||||
hi def link VimwikiCodeChar VimwikiMarkers
|
hi def link VimwikiCodeChar VimwikiMarkers
|
||||||
hi def link VimwikiHeaderChar VimwikiMarkers
|
hi def link VimwikiHeaderChar VimwikiMarkers
|
||||||
|
|
||||||
" TODO remove unsued due to region refactoring
|
" TODO remove unused due to region refactoring
|
||||||
hi def link VimwikiEqInCharT VimwikiMarkers
|
hi def link VimwikiEqInCharT VimwikiMarkers
|
||||||
hi def link VimwikiBoldCharT VimwikiMarkers
|
hi def link VimwikiBoldCharT VimwikiMarkers
|
||||||
hi def link VimwikiItalicCharT VimwikiMarkers
|
hi def link VimwikiItalicCharT VimwikiMarkers
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ Given (Void for Accessing other files within vimwiki #979 {{{1):
|
|||||||
Do (At Index: Create and goto pythonfile):
|
Do (At Index: Create and goto pythonfile):
|
||||||
:VimwikiIndex 2\<Cr>
|
:VimwikiIndex 2\<Cr>
|
||||||
Opyfile.py\<Esc>\<Cr>\<Cr>
|
Opyfile.py\<Esc>\<Cr>\<Cr>
|
||||||
:AssertEqual 'pyfile.py', expand('%:t')\<CR>
|
" See #950 appending to every file: https://github.com/vimwiki/vimwiki/issues/950
|
||||||
|
:AssertEqual 'pyfile.py.md', expand('%:t')\<CR>
|
||||||
:AssertEqual 'python', &ft\<CR>
|
:AssertEqual 'python', &ft\<CR>
|
||||||
:Log "Clean pyfile"\<Cr>
|
:Log "Clean pyfile"\<Cr>
|
||||||
dd
|
dd
|
||||||
:VimwikiIndex 2\<Cr>
|
:VimwikiIndex 2\<Cr>
|
||||||
:call DeleteFile('pyfile.py')\<Cr>
|
" :call DeleteFile('pyfile.py')\<Cr>
|
||||||
|
|
||||||
|
|
||||||
Do (At Index: Create and goto markdownfile):
|
Do (At Index: Create and goto markdownfile):
|
||||||
@@ -22,6 +23,6 @@ Do (At Index: Create and goto markdownfile):
|
|||||||
:Log "Clean mdfile"\<Cr>
|
:Log "Clean mdfile"\<Cr>
|
||||||
:VimwikiIndex 2\<Cr>
|
:VimwikiIndex 2\<Cr>
|
||||||
dd
|
dd
|
||||||
:call DeleteFile('mdfile.md')\<Cr>
|
" :call DeleteFile('mdfile.md')\<Cr>
|
||||||
|
|
||||||
# vim: sw=2:foldmethod=marker:foldlevel=30:foldignore=:
|
# vim: sw=2:foldmethod=marker:foldlevel=30:foldignore=:
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
anything in filenew: empirically it does not count anything in filenew: empirically it does not count anything in filenew: empirically it does not count anything in filenew: empirically it does not count anything in filenew: empirically it does not count
|
||||||
+95
-49
@@ -36,13 +36,22 @@ Given vimwiki (VimwikiTOC with link and number {{{1):
|
|||||||
Execute (Set syntax markdown):
|
Execute (Set syntax markdown):
|
||||||
call SetSyntax('markdown')
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Expect('No change'):
|
||||||
|
[link1](#i-v-p-741528)
|
||||||
|
[link2](#i-v-p-741528-2)
|
||||||
|
|
||||||
|
# I [V p](h) (7.415.28)
|
||||||
|
|
||||||
|
# I [V p](h) 741.528
|
||||||
|
|
||||||
Do (Enter link):
|
Do (Enter link):
|
||||||
gg\<Cr>
|
gg\<Cr>
|
||||||
A__HERE1__\<Esc>
|
A__HERE1__\<Esc>
|
||||||
ggj\<Cr>
|
ggj\<Cr>
|
||||||
A__HERE2__\<Esc>
|
A__HERE2__\<Esc>
|
||||||
|
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
|
||||||
|
|
||||||
Expect():
|
Expect(Some suffix added after headings):
|
||||||
[link1](#i-v-p-741528)
|
[link1](#i-v-p-741528)
|
||||||
[link2](#i-v-p-741528-2)
|
[link2](#i-v-p-741528-2)
|
||||||
|
|
||||||
@@ -192,6 +201,9 @@ Given vimwiki (Internal links + one link to filenew):
|
|||||||
Execute (Set filename wiki_test.md):
|
Execute (Set filename wiki_test.md):
|
||||||
call SetSyntax('markdown')
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Set filename wiki_test.md):
|
||||||
|
file wiki_test.md
|
||||||
|
|
||||||
Do (Navigate with <Tab>):
|
Do (Navigate with <Tab>):
|
||||||
A more Contents\<Esc>
|
A more Contents\<Esc>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
@@ -201,6 +213,7 @@ Do (Navigate with <Tab>):
|
|||||||
\<Tab>
|
\<Tab>
|
||||||
\<Enter>
|
\<Enter>
|
||||||
A more Test2\<Esc>
|
A more Test2\<Esc>
|
||||||
|
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
|
||||||
|
|
||||||
Expect (Content added to titles):
|
Expect (Content added to titles):
|
||||||
# Contents more Contents
|
# Contents more Contents
|
||||||
@@ -231,9 +244,23 @@ Do (Navigate with <Tab> and <Enter> and come back with <Bs>):
|
|||||||
\<Tab>
|
\<Tab>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
|
# Debugging
|
||||||
|
:redir @a\<Cr>
|
||||||
|
:nmap <Bs>\<Cr>
|
||||||
|
:redir END\<Cr>
|
||||||
|
# :fixdel\<Cr>
|
||||||
|
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
|
||||||
|
# :AssertEqual 'toto', @a\<Cr>
|
||||||
# Cursor at Test2/filenew
|
# Cursor at Test2/filenew
|
||||||
A not yet\<Esc>
|
A not yet\<Esc>\<Esc>
|
||||||
|
# Debug
|
||||||
|
:Log 'Debugging 1, cursor position list'\<Cr>
|
||||||
|
:Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
|
||||||
|
# :VimwikiGoBackLink\<Cr>
|
||||||
|
# :call vimwiki#base#go_back_link()\<Cr>
|
||||||
\<Bs>
|
\<Bs>
|
||||||
|
:Log 'Debugging 2, cursor position list'\<Cr>
|
||||||
|
:Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
|
||||||
# Cursor at Test1/test2
|
# Cursor at Test1/test2
|
||||||
A near Test1/test2
|
A near Test1/test2
|
||||||
\<Esc>
|
\<Esc>
|
||||||
@@ -260,51 +287,70 @@ Expect (Vimwiki links):
|
|||||||
- [Test2](#Test2)
|
- [Test2](#Test2)
|
||||||
- [filenew](filenew) not yet
|
- [filenew](filenew) not yet
|
||||||
|
|
||||||
Do (Navigate with <Tab> comeback with <Bs> from filenew):
|
|
||||||
\<Tab>
|
|
||||||
A first shot\<Esc>
|
|
||||||
0\<Tab>
|
|
||||||
# Cursor at Contents/test1
|
|
||||||
\<Enter>
|
|
||||||
\<Tab>
|
|
||||||
\<Tab>
|
|
||||||
A first shot\<Esc>
|
|
||||||
0\<Tab>
|
|
||||||
# Cursor at Test1/test2
|
|
||||||
\<Enter>
|
|
||||||
G
|
|
||||||
# Cursor at Test2/filenew
|
|
||||||
A first shot\<Esc>
|
|
||||||
0\<Tab>
|
|
||||||
# Cursor at Test2/filenew
|
|
||||||
\<Enter>
|
|
||||||
# Cursor in filenew (a new file)
|
|
||||||
A anything in filenew: empirically it does not count\<Esc>
|
|
||||||
\<Bs>
|
|
||||||
# Cursor at Test2/filenew
|
|
||||||
\<Bs>
|
|
||||||
# Cursor at Test1/test2
|
|
||||||
\<Bs>
|
|
||||||
# Cursor at Contents/test1
|
|
||||||
A second shot
|
|
||||||
|
|
||||||
Expect (Just Contents/test1 got the second shot):
|
###################################
|
||||||
# Contents
|
###################################
|
||||||
|
###################################
|
||||||
|
###################################
|
||||||
|
# Commented out as butsetvar of the var prev_links is removing the list info at change of file for old Vim
|
||||||
|
|
||||||
- [Test1](#Test1) first shot second shot
|
|
||||||
- [Test2](#Test2)
|
|
||||||
|
|
||||||
# Test1
|
|
||||||
|
|
||||||
- [Test1](#Test1)
|
|
||||||
- [Test2](#Test2) first shot
|
|
||||||
- [filenew](filenew)
|
|
||||||
|
|
||||||
# Test2
|
#Do (Navigate with <Tab> comeback with <Bs> from filenew):
|
||||||
|
# \<Tab>
|
||||||
- [Test1](#Test1)
|
# A first shot\<Esc>
|
||||||
- [Test2](#Test2)
|
# 0\<Tab>
|
||||||
- [filenew](filenew) first shot
|
## Cursor at Contents/test1
|
||||||
|
# \<Cr>
|
||||||
|
# \<Tab>
|
||||||
|
# \<Tab>
|
||||||
|
# A first shot\<Esc>
|
||||||
|
# 0\<Tab>
|
||||||
|
## Cursor at Test1/test2
|
||||||
|
# \<Cr>
|
||||||
|
# G
|
||||||
|
## Cursor at Test2/filenew
|
||||||
|
# A first shot\<Esc>
|
||||||
|
# 0\<Tab>
|
||||||
|
## Cursor at Test2/filenew
|
||||||
|
# \<Cr>
|
||||||
|
## Cursor in filenew (a new file)
|
||||||
|
# A anything in filenew: empirically it does not count\<Esc>
|
||||||
|
## Debug back
|
||||||
|
# :Log 'Debugging back 1, cursor position list'\<Cr>
|
||||||
|
# :Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
|
||||||
|
# :Log expand('%:p')\<Cr>
|
||||||
|
# :Log expand('/tmp/vader_wiki/testplugin/wiki_test.md')\<Cr>
|
||||||
|
# :Log filereadable('/tmp/vader_wiki/testplugin/wiki_test.md')\<Cr>
|
||||||
|
# \<Bs>
|
||||||
|
# :Log 'Debugging back 2, cursor position list'\<Cr>
|
||||||
|
# :Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
|
||||||
|
# :Log expand('%')\<Cr>
|
||||||
|
## Cursor at Test2/filenew
|
||||||
|
# \<Bs>
|
||||||
|
## Cursor at Test1/test2
|
||||||
|
# \<Bs>
|
||||||
|
## Cursor at Contents/test1
|
||||||
|
# A second shot
|
||||||
|
#
|
||||||
|
#Expect (Just Contents/test1 got the second shot):
|
||||||
|
# # Contents
|
||||||
|
#
|
||||||
|
# - [Test1](#Test1) first shot second shot
|
||||||
|
# - [Test2](#Test2)
|
||||||
|
#
|
||||||
|
# # Test1
|
||||||
|
#
|
||||||
|
# - [Test1](#Test1)
|
||||||
|
# - [Test2](#Test2) first shot
|
||||||
|
# - [filenew](filenew)
|
||||||
|
#
|
||||||
|
# # Test2
|
||||||
|
#
|
||||||
|
# - [Test1](#Test1)
|
||||||
|
# - [Test2](#Test2)
|
||||||
|
# - [filenew](filenew) first shot
|
||||||
|
|
||||||
Execute (Delete filenew buffer):
|
Execute (Delete filenew buffer):
|
||||||
call DeleteFile('/testplugin/filenew.md')
|
call DeleteFile('/testplugin/filenew.md')
|
||||||
@@ -312,22 +358,22 @@ Execute (Delete filenew buffer):
|
|||||||
Do (Navigate with <Tab> comeback with <Bs> too far):
|
Do (Navigate with <Tab> comeback with <Bs> too far):
|
||||||
\<Tab>
|
\<Tab>
|
||||||
# Cursor at Contents/test1
|
# Cursor at Contents/test1
|
||||||
\<Enter>
|
\<Cr>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
# Cursor at Test1/test2
|
# Cursor at Test1/test2
|
||||||
\<Enter>
|
\<Cr>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
# Cursor at Test2/test1
|
# Cursor at Test2/test1
|
||||||
\<Enter>
|
\<Cr>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
# Cursor at Test1/test2
|
# Cursor at Test1/test2
|
||||||
\<Enter>
|
\<Cr>
|
||||||
A first test2\<Esc>
|
A first test2\<Esc>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
# Cursor at Test2/test1
|
# Cursor at Test2/test1
|
||||||
\<Enter>
|
\<Cr>
|
||||||
A first test1\<Esc>
|
A first test1\<Esc>
|
||||||
# Back
|
# Back
|
||||||
\<Bs>
|
\<Bs>
|
||||||
@@ -355,7 +401,7 @@ Do (Navigate with <Tab> comeback with <Bs> too far):
|
|||||||
\<Bs>
|
\<Bs>
|
||||||
A 4\<Esc>
|
A 4\<Esc>
|
||||||
|
|
||||||
Expect (After too many <Bs>, cursor stays at the first <Enter> spot in first file: Contents/test1):
|
Expect (After too many <Bs>, cursor stays at the first <Cr> spot in first file: Contents/test1):
|
||||||
# Contents
|
# Contents
|
||||||
|
|
||||||
- [Test1](#Test1) 1 2 3 4
|
- [Test1](#Test1) 1 2 3 4
|
||||||
@@ -382,7 +428,7 @@ Given vimwiki (link to self):
|
|||||||
Do (Follow link to self and append chars):
|
Do (Follow link to self and append chars):
|
||||||
\<Tab>
|
\<Tab>
|
||||||
\<Tab>
|
\<Tab>
|
||||||
\<Enter>
|
\<Cr>
|
||||||
a this_is_18_chars \<Esc>
|
a this_is_18_chars \<Esc>
|
||||||
|
|
||||||
Expect (Some chars appended at self link):
|
Expect (Some chars appended at self link):
|
||||||
|
|||||||
@@ -38,19 +38,19 @@ Given vimwiki (filename filename.dot):
|
|||||||
filename
|
filename
|
||||||
filename.dot
|
filename.dot
|
||||||
|
|
||||||
Do():
|
Do (Press filename):
|
||||||
:call SetSyntax('default')\<CR>
|
:call SetSyntax('default')\<CR>
|
||||||
\<CR>\<CR>
|
\<CR>\<CR>
|
||||||
:AssertEqual 'filename.wiki', expand('%:t')\<CR>
|
:AssertEqual 'filename.wiki', expand('%:t')\<CR>
|
||||||
:call DeleteFile('%')\<CR>
|
:call DeleteFile('%')\<CR>
|
||||||
|
|
||||||
Do():
|
Do (Press filename.dot):
|
||||||
j
|
j
|
||||||
\<CR>\<CR>
|
\<CR>\<CR>
|
||||||
:AssertEqual 'filename.dot', expand('%:t')\<CR>
|
:AssertEqual 'filename.dot.wiki', expand('%:t')\<CR>
|
||||||
:call DeleteFile('%')\<CR>
|
:call DeleteFile('%')\<CR>
|
||||||
|
|
||||||
Expect(Nothing left):
|
Expect (Nothing left):
|
||||||
|
|
||||||
|
|
||||||
# Linkify function {{{1
|
# Linkify function {{{1
|
||||||
@@ -331,13 +331,14 @@ Given vimwiki (filnames with dots):
|
|||||||
part1.part2.part3.md
|
part1.part2.part3.md
|
||||||
noext
|
noext
|
||||||
|
|
||||||
Do (Fllow link witout markdown):
|
Do (Follow link witout markdown):
|
||||||
\<Cr>\<Cr>
|
\<Cr>\<Cr>
|
||||||
:AssertEqual expand('%:t'), 'part1.part2.part3'\<Cr>
|
" See issue #950 always adding the extension
|
||||||
|
:AssertEqual 'part1.part2.part3.md', expand('%:t')\<Cr>
|
||||||
|
|
||||||
Do (j<Cr><Cr>):
|
Do (Follow link with .md extension):
|
||||||
j\<Cr>\<Cr>
|
j\<Cr>\<Cr>
|
||||||
:AssertEqual expand('%:t'), 'part1.part2.part3.md'\<Cr>
|
:AssertEqual 'part1.part2.part3.md', expand('%:t')\<Cr>
|
||||||
|
|
||||||
|
|
||||||
# Rest {{{1
|
# Rest {{{1
|
||||||
|
|||||||
@@ -161,9 +161,14 @@ Do (Create in_root):
|
|||||||
0\<CR>\<CR>
|
0\<CR>\<CR>
|
||||||
:AssertEqual 'file ' . $HOME . '/testmarkdown/dir1/dir11/in_dir11.md', 'file ' . expand('%')\<CR>
|
:AssertEqual 'file ' . $HOME . '/testmarkdown/dir1/dir11/in_dir11.md', 'file ' . expand('%')\<CR>
|
||||||
|
|
||||||
:Log 'One backspace for fun'\<CR>
|
|
||||||
\<BS>
|
|
||||||
:AssertEqual 'file ' . $HOME . '/testmarkdown/in_root.md', 'file ' . expand('%')\<CR>
|
# TODO this does break for old Vim for the buffer local prev_links list is deleted => Cannot change file
|
||||||
|
|
||||||
|
|
||||||
|
# :Log 'One backspace for fun'\<CR>
|
||||||
|
# \<BS>
|
||||||
|
# :AssertEqual 'file ' . $HOME . '/testmarkdown/in_root.md', 'file ' . expand('%')\<CR>
|
||||||
|
|
||||||
|
|
||||||
Do (Create dir_11 -> dir_11):
|
Do (Create dir_11 -> dir_11):
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
files.extend-exclude = ["test", "autoload/vimwiki/emoji.vim", "doc/vimwiki-emoji.txt"]
|
||||||
|
|
||||||
|
[default.extend-words]
|
||||||
|
# For the fo-table
|
||||||
|
fo = "fo"
|
||||||
|
Gude = "Gude"
|
||||||
+41
-31
@@ -7,6 +7,10 @@
|
|||||||
echo -en "Starting $(basename "$0") for VimWiki\n"
|
echo -en "Starting $(basename "$0") for VimWiki\n"
|
||||||
start_time=$(date +%s)
|
start_time=$(date +%s)
|
||||||
|
|
||||||
|
red='\033[0;31m'
|
||||||
|
green='\033[0;32m'
|
||||||
|
nc='\033[0m'
|
||||||
|
|
||||||
# For windows: Cmder bash is appending busybox to the path and
|
# For windows: Cmder bash is appending busybox to the path and
|
||||||
# and a smlll vim is included, so that override the windows path vim
|
# and a smlll vim is included, so that override the windows path vim
|
||||||
if [[ -v OLD_PATH ]]; then
|
if [[ -v OLD_PATH ]]; then
|
||||||
@@ -38,8 +42,12 @@ printHelp() {
|
|||||||
|
|
||||||
-v (Verbose) Turn on verbose output.
|
-v (Verbose) Turn on verbose output.
|
||||||
|
|
||||||
|
E.g. On Linux without with local Vim
|
||||||
|
bash run_tests.sh -v -t vader -n local -f link_creation.vader issue_markdown.vader
|
||||||
|
|
||||||
E.g. On Linux
|
E.g. On Linux
|
||||||
bash run_tests.sh -v -t vader -n "vim_7.4.1099 vim_8.1.0519" -f link_creation.vader issue_markdown.vader
|
bash run_tests.sh -v -t vader -n "vim_7.4.1099 vim_8.1.0519" -f link_creation.vader issue_markdown.vader
|
||||||
|
|
||||||
E.g. On Windows
|
E.g. On Windows
|
||||||
bash run_tests.sh -v -t vader -n local -f z_success.vader | cat
|
bash run_tests.sh -v -t vader -n local -f z_success.vader | cat
|
||||||
EOF
|
EOF
|
||||||
@@ -47,13 +55,16 @@ printHelp() {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
printVersions() {
|
|
||||||
|
print_versions() {
|
||||||
# Print the names of all vim/nvim versions
|
# Print the names of all vim/nvim versions
|
||||||
getVers
|
# Get all possible version <- Dockerfile
|
||||||
|
sed -n 's/.* -name \([^ ]*\) .*/\1/p' ../Dockerfile
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
runVader() {
|
|
||||||
|
run_vader() {
|
||||||
# Run Vader tests
|
# Run Vader tests
|
||||||
echo -e "\nStarting Vader tests."
|
echo -e "\nStarting Vader tests."
|
||||||
local err=0
|
local err=0
|
||||||
@@ -64,6 +75,9 @@ runVader() {
|
|||||||
else
|
else
|
||||||
read -ra TEST <<< "$file_test"
|
read -ra TEST <<< "$file_test"
|
||||||
for i in "${TEST[@]}"; do
|
for i in "${TEST[@]}"; do
|
||||||
|
# Remove quotes
|
||||||
|
i=${i#\'}
|
||||||
|
i=${i%\'}
|
||||||
if [[ "$i" == *"*"* ]]; then
|
if [[ "$i" == *"*"* ]]; then
|
||||||
res="$res test/${i}"
|
res="$res test/${i}"
|
||||||
elif [[ -f "$i" ]]; then
|
elif [[ -f "$i" ]]; then
|
||||||
@@ -139,7 +153,8 @@ runVader() {
|
|||||||
|
|
||||||
# Run the tests
|
# Run the tests
|
||||||
fcmd(){
|
fcmd(){
|
||||||
$vim $vim_opt "+Vader! ${res}" 2>&1
|
$vim $vim_opt "+Vader! ${res}" 2>&1 \
|
||||||
|
| vader_filter | vader_color
|
||||||
return ${PIPESTATUS[1]}
|
return ${PIPESTATUS[1]}
|
||||||
}
|
}
|
||||||
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
|
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
|
||||||
@@ -176,7 +191,8 @@ runVader() {
|
|||||||
return $err
|
return $err
|
||||||
}
|
}
|
||||||
|
|
||||||
runVint() {
|
|
||||||
|
run_vint() {
|
||||||
local err=0
|
local err=0
|
||||||
cmd="vint -s . && vint -s test/vimrc"
|
cmd="vint -s . && vint -s test/vimrc"
|
||||||
if echo "$vers" | grep "local" > /dev/null; then
|
if echo "$vers" | grep "local" > /dev/null; then
|
||||||
@@ -195,10 +211,6 @@ runVint() {
|
|||||||
return $err
|
return $err
|
||||||
}
|
}
|
||||||
|
|
||||||
getVers() {
|
|
||||||
# Get all possible version <- Dockerfile
|
|
||||||
sed -n 's/.* -name \([^ ]*\) .*/\1/p' ../Dockerfile
|
|
||||||
}
|
|
||||||
|
|
||||||
vader_filter() {
|
vader_filter() {
|
||||||
# Filter Vader Stdout
|
# Filter Vader Stdout
|
||||||
@@ -213,8 +225,9 @@ vader_filter() {
|
|||||||
[[ "$REPLY" = *'Vim: Error '* ]]; then
|
[[ "$REPLY" = *'Vim: Error '* ]]; then
|
||||||
echo "$REPLY"
|
echo "$REPLY"
|
||||||
elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
|
elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
|
||||||
|
[[ "$REPLY" = *'[ DO] (X)'* ]] || \
|
||||||
[[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then
|
[[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then
|
||||||
echo "$REPLY"
|
echo -e "$red$REPLY$nc"
|
||||||
err=1
|
err=1
|
||||||
elif [[ "$REPLY" = *'Success/Total:'* ]]; then
|
elif [[ "$REPLY" = *'Success/Total:'* ]]; then
|
||||||
success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
|
success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
|
||||||
@@ -239,9 +252,6 @@ vader_filter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
red='\033[0;31m'
|
|
||||||
green='\033[0;32m'
|
|
||||||
nc='\033[0m'
|
|
||||||
vader_color() {
|
vader_color() {
|
||||||
while read -r; do
|
while read -r; do
|
||||||
if [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
|
if [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
|
||||||
@@ -280,7 +290,7 @@ wiki_path="$( realpath "$script_path/.." )"
|
|||||||
tmp_dir="$(dirname "$(mktemp -u)")"
|
tmp_dir="$(dirname "$(mktemp -u)")"
|
||||||
|
|
||||||
# list of vim/nvim versions
|
# list of vim/nvim versions
|
||||||
vers="$(getVers)"
|
vers="$(print_versions)"
|
||||||
|
|
||||||
# type of tests to run - vader/vint/all
|
# type of tests to run - vader/vint/all
|
||||||
type="all"
|
type="all"
|
||||||
@@ -296,29 +306,29 @@ flags=(--rm -v "$PWD/../:/testplugin" -v "$PWD/../test:/home" -w /testplugin vim
|
|||||||
|
|
||||||
while getopts ":hvn:lt:f:" opt; do
|
while getopts ":hvn:lt:f:" opt; do
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
h )
|
h)
|
||||||
printHelp
|
printHelp
|
||||||
;;
|
;;
|
||||||
n )
|
n)
|
||||||
vers="$OPTARG"
|
vers="$OPTARG"
|
||||||
;;
|
;;
|
||||||
v )
|
v)
|
||||||
verbose=1
|
verbose=1
|
||||||
;;
|
;;
|
||||||
l )
|
l)
|
||||||
printVersions
|
print_versions
|
||||||
;;
|
;;
|
||||||
t )
|
t)
|
||||||
type="$OPTARG"
|
type="$OPTARG"
|
||||||
;;
|
;;
|
||||||
f )
|
f)
|
||||||
file_test="$OPTARG"
|
file_test="$OPTARG"
|
||||||
;;
|
;;
|
||||||
\? )
|
\?)
|
||||||
echo "Invalid option: $OPTARG" 1>&2
|
echo "Invalid option: $OPTARG" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
: )
|
:)
|
||||||
echo "Invalid option: $OPTARG requires an argument" 1>&2
|
echo "Invalid option: $OPTARG requires an argument" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
@@ -342,25 +352,25 @@ o_error=0
|
|||||||
|
|
||||||
# Select which tests should run
|
# Select which tests should run
|
||||||
case $type in
|
case $type in
|
||||||
"vader" )
|
vader)
|
||||||
runVader ; err=$?
|
run_vader ; err=$?
|
||||||
echo "Main Vader: returned $err"
|
echo "Main Vader: returned $err"
|
||||||
o_error=$(( err | o_error ))
|
o_error=$(( err | o_error ))
|
||||||
;;
|
;;
|
||||||
"vint" )
|
vint)
|
||||||
runVint ; err=$?
|
run_vint ; err=$?
|
||||||
echo "Main Vint: returned $err"
|
echo "Main Vint: returned $err"
|
||||||
o_error=$(( err | o_error ))
|
o_error=$(( err | o_error ))
|
||||||
;;
|
;;
|
||||||
"all" )
|
all)
|
||||||
runVint ; err=$?
|
run_vint ; err=$?
|
||||||
echo "Main Vint: returned $err"
|
echo "Main Vint: returned $err"
|
||||||
o_error=$(( err | o_error ))
|
o_error=$(( err | o_error ))
|
||||||
runVader ; err=$?
|
run_vader ; err=$?
|
||||||
echo "Main Vader: returned $err"
|
echo "Main Vader: returned $err"
|
||||||
o_error=$(( err | o_error ))
|
o_error=$(( err | o_error ))
|
||||||
;;
|
;;
|
||||||
* )
|
*)
|
||||||
echo "Error: invalid type - '$type'" 1>&2
|
echo "Error: invalid type - '$type'" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|||||||
+14
-9
@@ -11,9 +11,9 @@ Given vimwiki (Markdown typeface with escape sequence #1044: _ __ * ** {{{2):
|
|||||||
and __t \__ is still bold__ Bold 4
|
and __t \__ is still bold__ Bold 4
|
||||||
and _ita\_ alic continues and end_ Italic 5
|
and _ita\_ alic continues and end_ Italic 5
|
||||||
*this\* \* is italic also* Italic 6
|
*this\* \* is italic also* Italic 6
|
||||||
a ^t\^ is supperscrit^ Sup 7
|
a ^taa is supperscrit^ Sup 7
|
||||||
,,sub\,, subscript end,, Sub 8
|
,,subaaa subscript end,, Sub 8
|
||||||
a ~~st\~~ill deleted~~ Del 9
|
a ~~staaill deleted~~ Del 9
|
||||||
$$Eq\$$ uation follows$ Math 10
|
$$Eq\$$ uation follows$ Math 10
|
||||||
`code \` not finished inline` Code 11
|
`code \` not finished inline` Code 11
|
||||||
|
|
||||||
@@ -26,7 +26,8 @@ Execute (Assert Syntax of escape typeface):
|
|||||||
AssertEqual '3' , SyntaxAt(3, 14) . 3
|
AssertEqual '3' , SyntaxAt(3, 14) . 3
|
||||||
AssertEqual 'VimwikiBold4' , SyntaxAt(4, 14) . 4
|
AssertEqual 'VimwikiBold4' , SyntaxAt(4, 14) . 4
|
||||||
AssertEqual 'VimwikiItalic5' , SyntaxAt(5, 14) . 5
|
AssertEqual 'VimwikiItalic5' , SyntaxAt(5, 14) . 5
|
||||||
AssertEqual 'VimwikiItalic6' , SyntaxAt(6, 14) . 6
|
" See: #1303 where an escape start can close the region
|
||||||
|
AssertEqual '6' , SyntaxAt(6, 14) . 6
|
||||||
AssertEqual 'VimwikiSuperScript7', SyntaxAt(7, 14) . 7
|
AssertEqual 'VimwikiSuperScript7', SyntaxAt(7, 14) . 7
|
||||||
AssertEqual 'VimwikiSubScript8' , SyntaxAt(8, 14) . 8
|
AssertEqual 'VimwikiSubScript8' , SyntaxAt(8, 14) . 8
|
||||||
AssertEqual 'VimwikiDelText9' , SyntaxAt(9, 14) . 9
|
AssertEqual 'VimwikiDelText9' , SyntaxAt(9, 14) . 9
|
||||||
@@ -67,8 +68,8 @@ Given vimwiki (Markdown bad __this_not_it__ {{{2):
|
|||||||
n4rmal_aaaaaaaaaaaaaaaaaaaa_text_ 4
|
n4rmal_aaaaaaaaaaaaaaaaaaaa_text_ 4
|
||||||
n5t_italiccccccccccccccccccccc_no 5
|
n5t_italiccccccccccccccccccccc_no 5
|
||||||
n6t_italiccccccccccccccccccccccno 6
|
n6t_italiccccccccccccccccccccccno 6
|
||||||
n7t*italiccccccccccccccccccccc_no 7
|
n7t*italiccccccccccccccccccccc*si 7
|
||||||
n8t*italiccccccccccccccccccccc*no 8
|
n8taitalicccccccccccccccccccccasi 8
|
||||||
__not_italicccccccccc_but_boldd__ 9
|
__not_italicccccccccc_but_boldd__ 9
|
||||||
_a_asdasda_asdas_asdas_asdasda_a_ 10
|
_a_asdasda_asdas_asdas_asdasda_a_ 10
|
||||||
_jitaliccccccccccccccccccccccccc_ 11
|
_jitaliccccccccccccccccccccccccc_ 11
|
||||||
@@ -83,16 +84,20 @@ Execute (Set syntax markdown):
|
|||||||
|
|
||||||
Execute (Assert Syntax (bravo)):
|
Execute (Assert Syntax (bravo)):
|
||||||
AssertEqual 'VimwikiError2' , SyntaxAt(2, 4) . 2
|
AssertEqual 'VimwikiError2' , SyntaxAt(2, 4) . 2
|
||||||
AssertEqual 'VimwikiError3' , SyntaxAt(3, 4) . 3
|
" See: #1303 where the * is now accepted in the middle of the words
|
||||||
|
" So no more trick like in _
|
||||||
|
" syn match VimwikiError "\w\@<=_\w\@=" remove the *
|
||||||
|
AssertEqual 'VimwikiDelimiter3' , SyntaxAt(3, 4) . 3
|
||||||
AssertEqual '4' , SyntaxAt(4, 14) . 4
|
AssertEqual '4' , SyntaxAt(4, 14) . 4
|
||||||
AssertEqual '5' , SyntaxAt(5, 14) . 5
|
AssertEqual '5' , SyntaxAt(5, 14) . 5
|
||||||
AssertEqual '6' , SyntaxAt(6, 14) . 6
|
AssertEqual '6' , SyntaxAt(6, 14) . 6
|
||||||
AssertEqual '7' , SyntaxAt(7, 14) . 7
|
AssertEqual 'VimwikiItalic7' , SyntaxAt(7, 14) . 7
|
||||||
AssertEqual '8' , SyntaxAt(8, 14) . 8
|
AssertEqual '8' , SyntaxAt(8, 14) . 8
|
||||||
AssertEqual 'VimwikiBold9' , SyntaxAt(9, 14) . 9
|
AssertEqual 'VimwikiBold9' , SyntaxAt(9, 14) . 9
|
||||||
AssertEqual 'VimwikiItalic10' , SyntaxAt(10, 14) . 10
|
AssertEqual '10' , SyntaxAt(10, 14) . 10
|
||||||
AssertEqual 'VimwikiItalic11' , SyntaxAt(11, 14) . 11
|
AssertEqual 'VimwikiItalic11' , SyntaxAt(11, 14) . 11
|
||||||
AssertEqual '12' , SyntaxAt(12, 14) . 12
|
AssertEqual '12' , SyntaxAt(12, 14) . 12
|
||||||
|
AssertEqual 'VimwikiItalic13' , SyntaxAt(13, 14) . 13
|
||||||
|
|
||||||
Given vimwiki (bold and pre {{{2):
|
Given vimwiki (bold and pre {{{2):
|
||||||
__startbold
|
__startbold
|
||||||
|
|||||||
@@ -0,0 +1,171 @@
|
|||||||
|
# Github Favor Markdown Typeface
|
||||||
|
# https://github.github.com/gfm
|
||||||
|
# 6.4 Emphasis and strong emphasis
|
||||||
|
|
||||||
|
|
||||||
|
# Rule 1 {{{1
|
||||||
|
# A single * character can open emphasis iff (if and only if) it is part of a left-flanking delimiter run.'
|
||||||
|
#################
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-360):
|
||||||
|
*foo bar*
|
||||||
|
|
||||||
|
Execute (Log rule):
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Italic'
|
||||||
|
AssertEqual 'VimwikiItalic', SyntaxAt(1, 2)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-361):
|
||||||
|
a * foo bar*
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'This is not emphasis, because the opening * is followed by whitespace, and hence not part of a left-flanking delimiter'
|
||||||
|
AssertEqual '', SyntaxAt(1, 5)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-362):
|
||||||
|
todo TODO
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'TODO'
|
||||||
|
AssertEqual '', SyntaxAt(1, 5)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-363):
|
||||||
|
* a *
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Unicode nonbreaking spaces count as whitespace, too'
|
||||||
|
AssertEqual '', SyntaxAt(1, 3)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-364):
|
||||||
|
foo*bar*
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Intraword emphasis with * is permitted:'
|
||||||
|
AssertEqual 'VimwikiItalic', SyntaxAt(1, 5)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-365):
|
||||||
|
5*6*78
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
|
||||||
|
|
||||||
|
|
||||||
|
# Rule 2 {{{1
|
||||||
|
# A single _ character can open emphasis iff it is part of a left-flanking delimiter run and either (a) not part of a right-flanking delimiter run or (b) part of a right-flanking delimiter run preceded by punctuation.
|
||||||
|
#################
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-366):
|
||||||
|
_foo bar_
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Italic'
|
||||||
|
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-367):
|
||||||
|
_ foo bar_
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'This is not emphasis, because the opening _ is followed by whitespace'
|
||||||
|
AssertEqual '', SyntaxAt(1, 3)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-368):
|
||||||
|
a_"foo"_
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Italic'
|
||||||
|
AssertEqual '', SyntaxAt(1, 4)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-369):
|
||||||
|
foo_bar_
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Emphasis with _ is not allowed inside words'
|
||||||
|
AssertEqual '', SyntaxAt(1, 5)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-370):
|
||||||
|
* 5_6_78
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
AssertEqual '', SyntaxAt(1, 3)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-371):
|
||||||
|
CommentLine 'Not emphasis in middle even if unicode alphanumeric before left delimiter'
|
||||||
|
пристаням_стремятся_
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
AssertEqual '', SyntaxAt(1, 22)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-372):
|
||||||
|
* aa_"bb"_cc
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'Here _ does not generate emphasis, because the first delimiter run is right-flanking and the second left-flanking'
|
||||||
|
AssertEqual '', SyntaxAt(1, 5)
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Typeface: https://github.github.com/gfm/#example-373):
|
||||||
|
foo-_(bar)_
|
||||||
|
|
||||||
|
Execute (Set Markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
Execute (Assert Syntax):
|
||||||
|
CommentLine 'This is emphasis, even though the opening delimiter is both left- and right-flanking, because it is preceded by punctuation'
|
||||||
|
AssertEqual 'VimwikiItalic', SyntaxAt(1, 7)
|
||||||
|
|
||||||
|
|
||||||
|
# Rule 3 {{{1
|
||||||
|
# TODO Test 3
|
||||||
|
|
||||||
|
# vim: foldmethod=marker foldlevel=30 sw=2
|
||||||
+17
-6
@@ -1,7 +1,6 @@
|
|||||||
" TODO treat if local (see $HOME in all tests)
|
" TODO treat if local (see $HOME in all tests)
|
||||||
" TODO mutualise (to prettify output) mode(1) to check if in -Es or not
|
" TODO mutualise (to prettify output) mode(1) to check if in -Es or not
|
||||||
" TODO test tabnext in at least one travis job (without -Es)
|
" TODO test tabnext in at least one travis job (without -Es)
|
||||||
" IDEA fasten travis difefrent job with the same vimwiki git (-8s)
|
|
||||||
|
|
||||||
" Declare tipical Vim preambule
|
" Declare tipical Vim preambule
|
||||||
" vint: -ProhibitSetNoCompatible
|
" vint: -ProhibitSetNoCompatible
|
||||||
@@ -14,12 +13,14 @@
|
|||||||
let $THOME = $HOME
|
let $THOME = $HOME
|
||||||
|
|
||||||
" Set chrooted virtual runtime path
|
" Set chrooted virtual runtime path
|
||||||
let rtp=$ROOT.'/rtp.vim'
|
let rtp = $ROOT . '/rtp.vim'
|
||||||
exe 'source '.rtp
|
if filereadable(rtp)
|
||||||
|
execute 'source ' . rtp
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Load Vader
|
" Load Vader
|
||||||
let vader=$ROOT.'/vader'
|
let vader = $ROOT.'/vader'
|
||||||
exe 'set runtimepath+='.vader
|
exe 'set runtimepath+='.vader
|
||||||
|
|
||||||
|
|
||||||
@@ -114,6 +115,14 @@
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Define functions
|
" Define functions
|
||||||
|
function! CommentLine(msg)
|
||||||
|
" Log current line and argument message
|
||||||
|
" Called: in GFM copying like: https://github.github.com/gfm/#example-360 in syntax_markdown_gfm_typeface.vader
|
||||||
|
Log 'Content: `' . getline('.') . '`'
|
||||||
|
Log 'Comment: ' . a:msg
|
||||||
|
endfunction
|
||||||
|
command! -nargs=1 CommentLine call CommentLine(<args>)
|
||||||
|
|
||||||
function! SetSyntax(vw_syn)
|
function! SetSyntax(vw_syn)
|
||||||
" Change the syntax using a temporary wiki
|
" Change the syntax using a temporary wiki
|
||||||
" Change extension and wiki_nr
|
" Change extension and wiki_nr
|
||||||
@@ -366,7 +375,9 @@
|
|||||||
" Or rather: If execute() exists - it's not available for all 7.4
|
" Or rather: If execute() exists - it's not available for all 7.4
|
||||||
" versions.
|
" versions.
|
||||||
" https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
|
" https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
|
||||||
if has('patch-7.4-2008') != 1 | return [] | endif
|
|
||||||
|
" Clause: Dot not work if not able
|
||||||
|
if v:version < 800 && has('patch-7.4-2008') != 1 | return [] | endif
|
||||||
|
|
||||||
" Store output of group to variable
|
" Store output of group to variable
|
||||||
let out = execute('hi ' . a:group)
|
let out = execute('hi ' . a:group)
|
||||||
@@ -379,7 +390,7 @@
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Return the unique term we are looking for
|
" Return the unique term we are looking for
|
||||||
let stg = matchstr(out, a:term.'=\zs[^ \t\n\r]*')
|
let stg = matchstr(out, a:term . '=\zs[^[:space:]]*')
|
||||||
return split(stg, ',')
|
return split(stg, ',')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Contents more Contents
|
||||||
|
|
||||||
|
- [Test1](#Test1)
|
||||||
|
- [Test2](#Test2)
|
||||||
|
|
||||||
|
# Test1
|
||||||
|
|
||||||
|
- [Test1](#Test1)
|
||||||
|
- [Test2](#Test2)
|
||||||
|
- [filenew](filenew)
|
||||||
|
|
||||||
|
# Test2
|
||||||
|
|
||||||
|
- [Test1](#Test1)
|
||||||
|
- [Test2](#Test2)
|
||||||
|
- [filenew](filenew)
|
||||||
Reference in New Issue
Block a user