CI: Add Typos check and fix some typo

This commit is contained in:
Tinmarino
2023-03-12 01:15:28 -03:00
parent 48ce5b811d
commit 6d4208157d
15 changed files with 103 additions and 59 deletions
+17 -17
View File
@@ -664,7 +664,7 @@ function! vimwiki#base#get_anchors(filename, syntax) abort
let h_match = matchlist(line, rxheader)
if !empty(h_match)
let header = vimwiki#base#normalize_anchor(h_match[2])
" Mesure: header level
" Measure: header level
let level = len(h_match[1])
call add(anchors, 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
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 previous_anchors[anchor] = anchor_nb
" Append suffix
@@ -816,7 +816,7 @@ function! vimwiki#base#unnormalize_anchor(anchor) abort
" For each char
let anchor_loop = ''
for char in split(anchor, '\zs')
" Nest the char for easyer debugging
" Nest the char for easier debugging
let anchor_loop .= '\%('
" 3 Change any space to a hyphen
@@ -825,7 +825,7 @@ function! vimwiki#base#unnormalize_anchor(anchor) abort
let anchor_loop .= invisible_rx.'\+'
" 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
" Match My_char . punctuation . ( link . punctuaction )?
" Note: Because there may be punctuation before ad after link
@@ -847,7 +847,7 @@ endfunction
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
" Get segments <= 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'),
\ '__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 is_last_segment = 0
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
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
let pos += 1
let is_last_segment = -1
@@ -1102,7 +1102,7 @@ endfunction
function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
" Edit File: (like :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: (1) vimwiki_prev_link
" :param: (2) vimwiki#u#ft_is_vw()
@@ -1117,7 +1117,7 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
endif
" 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
" getpos() directly after this command. Strange.
if !(a:command =~# ':\?[ed].*' && vimwiki#path#is_equal(a:filename, expand('%:p')))
@@ -1425,7 +1425,7 @@ function! vimwiki#base#nested_syntax(filetype, start, end, textSnipHl) abort
" attempting to include them.
" https://vi.stackexchange.com/a/10354
" 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).
if !empty(globpath(&runtimepath, 'syntax/'.a:filetype.'.vim'))
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
@@ -1655,7 +1655,7 @@ function! vimwiki#base#follow_link(split, ...) abort
\ vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl'))
if lnk !=# ''
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
endif
endif
@@ -1968,7 +1968,7 @@ function! vimwiki#base#rename_file(...) abort
else
" Should not happen
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
" Log success
@@ -2505,7 +2505,7 @@ function! vimwiki#base#table_of_contents(create) abort
" copy all local variables into dict (add a: if arguments are needed)
let GeneratorTOC = copy(l:)
function! GeneratorTOC.f() abort
" Clean heading informations
" Clean heading information
let numbering = vimwiki#vars#get_global('html_header_numbering')
" TODO numbering not used !
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
@@ -2668,7 +2668,7 @@ function! vimwiki#base#normalize_link_helper(str, rxUrl, rxDesc, template) abort
let descr = s:clean_url(url)
if descr ==# '' | return url | endif
endif
" Substiture placeholders
" Substitute placeholders
let lnk = s:safesubstitute(a:template, '__LinkDescription__', descr, '')
let lnk = s:safesubstitute(lnk, '__LinkUrl__', url, '')
let file_extension = vimwiki#vars#get_wikilocal('ext', vimwiki#vars#get_bufferlocal('wiki_nr'))
@@ -2846,7 +2846,7 @@ endfunction
function! vimwiki#base#complete_file(ArgLead, CmdLine, CursorPos) abort
" Complete filename relatie to current file
" Complete filename relative to current file
" Called: rename_file
" Start from current file
let base_path = expand('%:h')
@@ -2913,7 +2913,7 @@ function! s:get_title(match) abort
" Do not overwrite if g:page_title is already set
" 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
" occurences and evaluate \= for each one
" occurrences and evaluate \= for each one
if (g:page_title !=# '')
return
endif
@@ -3018,7 +3018,7 @@ function! vimwiki#base#colorize(...) range abort
" TODO Must be coherent with color_tag_template
" Arg1: Key, list them with VimwikiColorize completion
" 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 mode = a:0 > 1 ? a:2 : ''
let color_dic = vimwiki#vars#get_wikilocal('color_dic')
+2 -2
View File
@@ -184,7 +184,7 @@ endfunction
function! s:read_captions(files) abort
" Read all cpation in 1. <List>files
" Read all caption in 1. <List>files
" Return: <Dic>: key -> caption
let result = {}
let caption_level = vimwiki#vars#get_wikilocal('diary_caption_level')
@@ -452,7 +452,7 @@ function! vimwiki#diary#generate_diary_section() abort
let extension = vimwiki#vars#get_wikilocal('ext', wiki_nr)
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 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
call add(lines, repeat(' ', vimwiki#lst#get_list_margin()).bullet.entry)
+2 -2
View File
@@ -10,7 +10,7 @@ endif
let g:loaded_vimwiki_html_auto = 1
" 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*
" let s:default_syntax.rxBold = '\*[^*]\+\*'
let s:rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
@@ -1081,7 +1081,7 @@ function! s:process_tag_list(line, lists, lstLeadingSpaces) abort
return [processed, lines, lstLeadingSpaces]
endif
" Can embeded indented code in list (Issue #55)
" Can embedded indented code in list (Issue #55)
let b_permit = in_list
let blockquoteRegExp = '^\s\{' . (lstLeadingSpaces + 2) . ',}[^[:space:]>*-]'
let b_match = lstSym ==# '' && a:line =~# blockquoteRegExp
+1 -1
View File
@@ -17,7 +17,7 @@ function! s:windowsify(path) abort
endfunction
" Define: os specific path convertion
" Define: os specific path conversion
if vimwiki#u#is_windows()
function! s:osxify(path) abort
return s:windowsify(a:path)
+1 -1
View File
@@ -247,7 +247,7 @@ function! s:tags_entry_cmp(i1, i2) abort
"
" 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
" 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".)
let items = []
for orig_item in [a:i1, a:i2]
+5 -5
View File
@@ -53,9 +53,9 @@ function! vimwiki#u#deprecate(old, new) abort
endfunction
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
" Copyed from DarkWiiPlayer at stackoverflow
" Copied from DarkWiiPlayer at stackoverflow
" https://stackoverflow.com/a/47051271/2544873
" Get selection extremity position,
" Discriminate selection mode
@@ -271,7 +271,7 @@ endfunction
function! vimwiki#u#get_syntax_dic(...) abort
" 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')
return g:vimwiki_syntaxlocal_vars[syntax]
endfunction
@@ -315,7 +315,7 @@ function! vimwiki#u#hi_expand_regex(lst) abort
let r_right_del = a_delimiter[1]
" Regex Start:
" Left-Flanking is not followed by space (or ned of line)
" 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,
@@ -398,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)
" Some cases are contained by default:
" -- 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
" 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
+4 -4
View File
@@ -43,7 +43,7 @@ endfunction
function! s:check_users_value(key, users_value, value_infos, comes_from_global_variable) abort
" Helper: Check user setting
" 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: 3: value_infod <dict>: type and default value
" Param: 4: coming from a global variable <bool>
@@ -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])
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
let bullet_types = vimwiki#vars#get_wikilocal('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*$'
else
" asymmetric
" Note: For markdown rxH=# and asymetric
" Note: For markdown rxH=# and asymmetric
for i in range(1,6)
let syntax_dic['rxH'.i.'_Template'] =
\ repeat(header_symbol, i).' __Header__'
@@ -941,7 +941,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
\ '^\s*'.header_symbol.'\{1,'.i.'}[^'.header_symbol.'].*$\|\%$'
endfor
" Define header regex
" -- ATX heading := preceed by #*
" -- ATX heading := preceded by #*
let atx_heading = '^\s*\%('.header_symbol.'\{1,6}\)'
let atx_heading .= '\zs[^'.header_symbol.'].*\ze$'
let syntax_dic.rxHeader = atx_heading