This commit is contained in:
Adam Stankiewicz
2019-12-12 16:33:01 +01:00
parent 4d8423c962
commit 43085dc02f
7 changed files with 40 additions and 36 deletions

View File

@@ -20,7 +20,7 @@ syntax region jsxTag
\ matchgroup=NONE
\ end=+\%(/\_s*>\)\@=+
\ contained
\ contains=jsxOpenTag,jsxAttrib,jsxEscapeJs,jsxSpreadOperator,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment
\ contains=jsxOpenTag,jsxAttrib,jsxExpressionBlock,jsxSpreadOperator,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment
\ keepend
\ extend
\ skipwhite
@@ -39,7 +39,7 @@ syntax region jsxElement
\ start=+<\_s*\%(>\|\${\|\z(\<[-:._$A-Za-z0-9]\+\>\)\)+
\ end=+/\_s*>+
\ end=+<\_s*/\_s*\z1\_s*>+
\ contains=jsxElement,jsxTag,jsxEscapeJs,jsxComment,jsxCloseTag,@Spell
\ contains=jsxElement,jsxTag,jsxExpressionBlock,jsxComment,jsxCloseTag,@Spell
\ keepend
\ extend
\ contained
@@ -66,7 +66,7 @@ exe 'syntax region jsxOpenTag
" <tag key={this.props.key}>
" ~~~~~~~~~~~~~~~~
syntax region jsxEscapeJs
syntax region jsxExpressionBlock
\ matchgroup=jsxBraces
\ start=+{+
\ end=+}+
@@ -84,7 +84,7 @@ syntax match jsxNamespace +:+ contained
" <tag id="sample">
" ~
syntax match jsxEqual +=+ contained skipwhite skipempty nextgroup=jsxString,jsxEscapeJs,jsxRegion
syntax match jsxEqual +=+ contained skipwhite skipempty nextgroup=jsxString,jsxExpressionBlock,jsxRegion
" <tag />
" ~~
@@ -154,10 +154,10 @@ if s:enable_tagged_jsx
\ end=+`+
\ extend
\ contained
\ contains=jsxElement,jsxEscapeJs
\ contains=jsxElement,jsxExpressionBlock
\ transparent
syntax region jsxEscapeJs
syntax region jsxExpressionBlock
\ matchgroup=jsxBraces
\ start=+\${+
\ end=+}+
@@ -171,14 +171,14 @@ if s:enable_tagged_jsx
\ matchgroup=NONE
\ end=+}\@1<=+
\ contained
\ contains=jsxEscapeJs
\ contains=jsxExpressionBlock
\ skipwhite
\ skipempty
\ nextgroup=jsxAttrib,jsxSpreadOperator
syntax keyword jsxAttribKeyword class contained
syntax match jsxSpreadOperator +\.\.\.+ contained nextgroup=jsxEscapeJs skipwhite
syntax match jsxSpreadOperator +\.\.\.+ contained nextgroup=jsxExpressionBlock skipwhite
syntax match jsxCloseTag +<//>+ contained

View File

@@ -122,7 +122,7 @@ fu! csv#Init(start, end, ...) "{{{3
" Enable vartabs for tab delimited files
if b:delimiter=="\t" && has("vartabs")&& !exists("b:csv_fixed_width_cols")
if get(b:, 'col_width', []) ==# []
call csv#CalculateColumnWidth('')
call csv#CalculateColumnWidth(line('$'))
endif
let &l:vts=join(b:col_width, ',')
let g:csv_no_conceal=1
@@ -574,7 +574,7 @@ fu! csv#MaxColumns(...) "{{{3
return len(b:csv_fixed_width_cols)
endif
endfu
fu! csv#ColWidth(colnr, ...) "{{{3
fu! csv#ColWidth(colnr, row, silent) "{{{3
" if a:1 is given, specifies the row, for which to calculate the width
"
" Return the width of a column
@@ -586,16 +586,15 @@ fu! csv#ColWidth(colnr, ...) "{{{3
if !exists("b:csv_fixed_width_cols")
if !exists("b:csv_list")
" only check first 10000 lines, to be faster
let last = line('$')
if exists("a:1") && !empty(a:1)
let last = a:1
endif
let last = a:row
if !get(b:, 'csv_arrange_use_all_rows', 0)
if last > 10000
let last = 10000
if !a:silent
call csv#Warn('File too large, only checking the first 10000 rows for the width')
endif
endif
endif
let b:csv_list=getline(skipfirst+1,last)
let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\')
call filter(b:csv_list, 'v:val !~ pat')
@@ -750,7 +749,7 @@ fu! csv#UnArrangeCol(match) "{{{3
" Strip leading white space, also trims empty recordcsv#
return substitute(a:match, '\%(^ \+\)\|\%( \+\ze'.b:delimiter. '\?$\)', '', 'g')
endfu
fu! csv#CalculateColumnWidth(row) "{{{3
fu! csv#CalculateColumnWidth(row, silent) "{{{3
" Internal function, not called from external,
" does not work with fixed width columns
" row for the row for which to calculate the width
@@ -763,7 +762,7 @@ fu! csv#CalculateColumnWidth(row) "{{{3
endif
let s:max_cols=csv#MaxColumns(line('.'))
for i in range(1,s:max_cols)
call add(b:col_width, csv#ColWidth(i, a:row))
call add(b:col_width, csv#ColWidth(i, a:row, a:silent))
endfor
catch /csv:no_col/
call csv#Warn("Error: getting Column numbers, aborting!")
@@ -1053,7 +1052,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
let maxcol=csv#MaxColumns(line('.'))
let cpos=getpos('.')[2]
if !exists("b:csv_fixed_width_cols")
let curwidth=CSVWidth()
let curwidth=CSVWidth(1)
call search(b:col, 'bc', line('.'))
endif
let spos=getpos('.')[2]
@@ -1146,7 +1145,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
" leave the column (if the next column is shorter)
if !exists("b:csv_fixed_width_cols")
let a = getpos('.')
if CSVWidth() == curwidth
if CSVWidth(1) == curwidth
let a[2]+= cpos-spos
endif
else
@@ -1159,7 +1158,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
" Move to the correct screen column
if !exists("b:csv_fixed_width_cols")
let a = getpos('.')
if CSVWidth() == curwidth
if CSVWidth(1) == curwidth
let a[2]+= cpos-spos
endif
else
@@ -1835,7 +1834,7 @@ fu! csv#ProcessFieldValue(field) "{{{3
if a == b:delimiter
try
let a=repeat(' ', csv#ColWidth(col))
let a=repeat(' ', csv#ColWidth(col, line('$'), 1))
catch
" no-op
endtry
@@ -2134,7 +2133,7 @@ fu! csv#NewRecord(line1, line2, count) "{{{3
if !exists("b:col_width")
" Best guess width
if exists("b:csv_fixed_width_cols")
let record .= printf("%*s", csv#ColWidth(item),
let record .= printf("%*s", csv#ColWidth(item, line('$'), 1),
\ b:delimiter)
else
let record .= printf("%20s", b:delimiter)
@@ -3145,7 +3144,9 @@ fu! CSVCount(col, fmt, first, last, ...) "{{{3
unlet! s:additional['distinct']
return (empty(result) ? 0 : result)
endfu
fu! CSVWidth() "{{{3
fu! CSVWidth(...) "{{{3
" do not output any warning
let silent = get(a:000, 0, 1)
" does not work with fixed width columns
if exists("b:csv_fixed_width_cols")
let c = getline(1,'$')
@@ -3164,7 +3165,7 @@ fu! CSVWidth() "{{{3
" Add width for last column
call add(width, max-y+1)
else
call csv#CalculateColumnWidth('')
call csv#CalculateColumnWidth(line('$'), silent)
let width=map(copy(b:col_width), 'v:val-1')
endif
return width

View File

@@ -353,7 +353,7 @@ function! go#config#FmtCommand() abort
endfunction
function! go#config#FmtOptions() abort
return get(g:, "go_fmt_options", {})
return get(b:, "go_fmt_options", get(g:, "go_fmt_options", {}))
endfunction
function! go#config#FmtFailSilently() abort
@@ -368,9 +368,9 @@ function! go#config#PlayOpenBrowser() abort
return get(g:, "go_play_open_browser", 1)
endfunction
function! go#config#GorenameCommand() abort
function! go#config#RenameCommand() abort
" delegate to go#config#GorenameBin for backwards compatability.
return get(g:, "go_gorename_command", go#config#GorenameBin())
return get(g:, "go_rename_command", go#config#GorenameBin())
endfunction
function! go#config#GorenameBin() abort

View File

@@ -70,9 +70,9 @@ function s:is_jsx_element(syntax)
return a:syntax =~? 'jsxElement'
endfunction
" Whether the specified syntax group is the jsxEscapeJs
function s:is_jsx_escape(syntax)
return a:syntax =~? 'jsxEscapeJs'
" Whether the specified syntax group is the jsxExpressionBlock
function s:is_jsx_expression(syntax)
return a:syntax =~? 'jsxExpressionBlock'
endfunction
" Whether the specified syntax group is the jsxBraces
@@ -191,7 +191,7 @@ endfunction
" - jsxRegion
" - jsxTaggedRegion
" - jsxElement
" - jsxEscapeJs
" - jsxExpressionBlock
" - Other
function s:syntax_context(lnum)
let start_col = s:start_col(a:lnum)
@@ -201,9 +201,9 @@ function s:syntax_context(lnum)
let i = 0
for syntax_name in reversed
" If the current line is jsxEscapeJs and not starts with jsxBraces
if s:is_jsx_escape(syntax_name)
return 'jsxEscapeJs'
" If the current line is jsxExpressionBlock and not starts with jsxBraces
if s:is_jsx_expression(syntax_name)
return 'jsxExpressionBlock'
endif
if s:is_jsx_region(syntax_name)
@@ -287,7 +287,7 @@ function! jsx_pretty#indent#get(js_indent)
endif
return s:jsx_indent_element(v:lnum)
elseif syntax_context == 'jsxEscapeJs'
elseif syntax_context == 'jsxExpressionBlock'
let prev_lnum = s:prev_lnum(v:lnum)
let prev_line = s:trim(getline(prev_lnum))

View File

@@ -66,6 +66,7 @@ let s:syng_strcom = s:syng_stringdoc + [
\ 'PercentStringDelimiter',
\ 'PercentSymbolDelimiter',
\ 'Regexp',
\ 'RegexpCharClass',
\ 'RegexpDelimiter',
\ 'RegexpEscape',
\ 'StringDelimiter',

View File

@@ -39,6 +39,7 @@ syntax region dhallString start=+''+ end=+''+ contains=@Spell,dhallInterpolation
syntax region dhallString start=+"+ end=+"+ contains=dhallInterpolation,dhallEsc
syntax region dhallString start=+"/+ end=+"+ contains=dhallInterpolation,dhallEsc
syntax keyword dhallBool True False
syntax match dhallHash "sha256:[a-f0-9]+"
highlight link dhallSingleSpecial Special
highlight link dhallIndex Special
@@ -60,6 +61,7 @@ highlight link dhallType Structure
highlight link dhallParens Special
highlight link dhallComment Comment
highlight link dhallMultilineComment Comment
highlight link dhallHash Keyword
let b:current_syntax = 'dhall'

View File

@@ -43,7 +43,7 @@ syn match zigBuiltinFn "\v\@(ptrToInt|rem|returnAddress|setCold|Type|shuffle)>"
syn match zigBuiltinFn "\v\@(setRuntimeSafety|setEvalBranchQuota|setFloatMode)>"
syn match zigBuiltinFn "\v\@(setGlobalLinkage|setGlobalSection|shlExact|This|hasDecl|hasField)>"
syn match zigBuiltinFn "\v\@(shlWithOverflow|shrExact|sizeOf|sqrt|byteSwap|subWithOverflow|intCast|floatCast|intToFloat|floatToInt|boolToInt|errSetCast)>"
syn match zigBuiltinFn "\v\@(truncate|typeId|typeInfo|typeName|typeOf|atomicRmw|bytesToSlice|sliceToBytes)>"
syn match zigBuiltinFn "\v\@(truncate|typeId|typeInfo|typeName|TypeOf|atomicRmw|bytesToSlice|sliceToBytes)>"
syn match zigBuiltinFn "\v\@(intToError|errorToInt|intToEnum|enumToInt|setAlignStack|frame|Frame|frameSize|bitReverse|Vector)>"
syn match zigBuiltinFn "\v\@(sin|cos|exp|exp2|ln|log2|log10|fabs|floor|ceil|trunc|round)>"