aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2021-11-22 10:53:57 +0100
committerGitHub <noreply@github.com>2021-11-22 10:53:57 +0100
commite6c46bac3f590bfa4ac544705f195e5122c02d7c (patch)
tree596acb3dab84db56c4d44083bc4ce6d30459fa78
parent64abd7be7993ed3fa031b5d71a4482871108093a (diff)
downloadrneovim-e6c46bac3f590bfa4ac544705f195e5122c02d7c.tar.gz
rneovim-e6c46bac3f590bfa4ac544705f195e5122c02d7c.tar.bz2
rneovim-e6c46bac3f590bfa4ac544705f195e5122c02d7c.zip
vim-patch:88a4205f1cfb (#16399)
Update runtime files https://github.com/vim/vim/commit/88a4205f1cfbdc328e987ab00521fc8a22447fc3
-rw-r--r--runtime/doc/autocmd.txt2
-rw-r--r--runtime/doc/eval.txt13
-rw-r--r--runtime/doc/helphelp.txt4
-rw-r--r--runtime/doc/map.txt5
-rw-r--r--runtime/doc/usr_20.txt2
-rw-r--r--runtime/doc/visual.txt3
-rw-r--r--runtime/ftplugin/indent.vim7
-rw-r--r--runtime/ftplugin/vb.vim82
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim180
-rw-r--r--runtime/syntax/indent.vim9
10 files changed, 194 insertions, 113 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 2737ac9b9f..7ca6b3cd8e 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -57,7 +57,7 @@ The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
See |autocmd-buflocal|.
Note: The ":autocmd" command can only be followed by another command when the
-'|' appears before {cmd}. This works: >
+'|' appears where the pattern is expected. This works: >
:augroup mine | au! BufRead | augroup END
But this sees "augroup" as part of the defined command: >
:augroup mine | au! BufRead * | augroup END
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 58d5d30146..02ff9fc591 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -5136,8 +5136,8 @@ getline({lnum} [, {end}])
digit, |line()| is called to translate the String into a Number.
To get the line under the cursor: >
getline(".")
-< When {lnum} is smaller than 1 or bigger than the number of
- lines in the buffer, an empty string is returned.
+< When {lnum} is a number smaller than 1 or bigger than the
+ number of lines in the buffer, an empty string is returned.
When {end} is given the result is a |List| where each item is
a line from the current buffer in the range {lnum} to {end},
@@ -7464,15 +7464,18 @@ printf({fmt}, {expr1} ...) *printf()*
field width. If the converted value has fewer bytes
than the field width, it will be padded with spaces on
the left (or right, if the left-adjustment flag has
- been given) to fill out the field width.
+ been given) to fill out the field width. For the S
+ conversion the count is in cells.
.precision
An optional precision, in the form of a period '.'
followed by an optional digit string. If the digit
string is omitted, the precision is taken as zero.
This gives the minimum number of digits to appear for
- d, o, x, and X conversions, or the maximum number of
- bytes to be printed from a string for s conversions.
+ d, o, x, and X conversions, the maximum number of
+ bytes to be printed from a string for s conversions,
+ or the maximum number of cells to be printed from a
+ string for S conversions.
For floating point it is the number of digits after
the decimal point.
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index c884eea54f..e7b489d6e1 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -319,7 +319,7 @@ Hints for translators:
3. Writing help files *help-writing*
For ease of use, a Vim help file for a plugin should follow the format of the
-standard Vim help files, except fot the fist line. If you are writing a new
+standard Vim help files, except for the first line. If you are writing a new
help file it's best to copy one of the existing files and use it as a
template.
@@ -332,7 +332,7 @@ remainder of the line, after a Tab, describes the plugin purpose in a short
way. This will show up in the "LOCAL ADDITIONS" section of the main help
file. Check there that it shows up properly: |local-additions|.
-If you want to add a version number of last modification date, put it in the
+If you want to add a version number or last modification date, put it in the
second line, right aligned.
At the bottom of the help file, place a Vim modeline to set the 'textwidth'
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 0b9ac42898..0ea2565694 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -81,6 +81,9 @@ modes.
Remove the mapping of {lhs} for the modes where the
map command applies. The mapping may remain defined
for other modes where it applies.
+ It also works when {lhs} matches the {rhs} of a
+ mapping. This is for when when an abbreviation
+ applied.
Note: Trailing spaces are included in the {lhs}. This
unmap does NOT work: >
:map @@ foo
@@ -320,6 +323,8 @@ Note:
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
unmapped keys.
- The command is not echo'ed, no need for <silent>.
+- The {rhs} is not subject to abbreviations nor to other mappings, even if the
+ mapping is recursive.
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
Visual area, the cursor is at the other end.
- In select-mode, |:map| and |:vmap| command mappings are executed in
diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt
index cff5c7d2f2..6a8836c8e8 100644
--- a/runtime/doc/usr_20.txt
+++ b/runtime/doc/usr_20.txt
@@ -292,7 +292,7 @@ to newer commands.
There are actually five histories. The ones we will mention here are for ":"
commands and for "/" and "?" search commands. The "/" and "?" commands share
the same history, because they are both search commands. The three other
-histories are for expressions, debug more commands and input lines for the
+histories are for expressions, debug mode commands and input lines for the
input() function. |cmdline-history|
Suppose you have done a ":set" command, typed ten more colon commands and then
diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt
index 111588e43a..4a69fc989b 100644
--- a/runtime/doc/visual.txt
+++ b/runtime/doc/visual.txt
@@ -360,7 +360,8 @@ same amount of text as the last time:
last line the same number of characters as in the last line the last time.
The start of the text is the Cursor position. If the "$" command was used as
one of the last commands to extend the highlighted text, the repeating will
-be applied up to the rightmost column of the longest line.
+be applied up to the rightmost column of the longest line. Any count passed
+to the `.` command is not used.
==============================================================================
diff --git a/runtime/ftplugin/indent.vim b/runtime/ftplugin/indent.vim
index e6d928a073..64a650ad7b 100644
--- a/runtime/ftplugin/indent.vim
+++ b/runtime/ftplugin/indent.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
-" Language: indent(1) configuration file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-07-09
+" Language: indent(1) configuration file
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
diff --git a/runtime/ftplugin/vb.vim b/runtime/ftplugin/vb.vim
index d70db89273..5a9548115b 100644
--- a/runtime/ftplugin/vb.vim
+++ b/runtime/ftplugin/vb.vim
@@ -1,44 +1,70 @@
" Vim filetype plugin file
-" Language: VisualBasic (ft=vb)
-" Maintainer: Johannes Zellner <johannes@zellner.org>
-" Last Change: Thu, 22 Nov 2001 12:56:14 W. Europe Standard Time
+" Language: Visual Basic (ft=vb)
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: 2021 Nov 17
-if exists("b:did_ftplugin") | finish | endif
+if exists("b:did_ftplugin")
+ finish
+endif
let b:did_ftplugin = 1
-setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
+let s:cpo_save = &cpo
+set cpo&vim
+
+setlocal comments=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
+setlocal commentstring='\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
+let b:undo_ftplugin = "setlocal com< cms< fo<"
" we need this wrapper, as call doesn't allow a count
-fun! <SID>VbSearch(pattern, flags)
+function! s:VbSearch(pattern, flags)
let cnt = v:count1
while cnt > 0
call search(a:pattern, a:flags)
let cnt = cnt - 1
endwhile
-endfun
+endfunction
-let s:cpo_save = &cpo
-set cpo&vim
+if !exists("no_plugin_maps") && !exists("no_vb_maps")
+ nnoremap <buffer> <silent> [[ <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sbW')<CR>
+ vnoremap <buffer> <silent> [[ <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sbW')<CR>
+ nnoremap <buffer> <silent> ]] <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sW')<CR>
+ vnoremap <buffer> <silent> ]] <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sW')<CR>
+ nnoremap <buffer> <silent> [] <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sbW')<CR>
+ vnoremap <buffer> <silent> [] <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sbW')<CR>
+ nnoremap <buffer> <silent> ][ <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sW')<CR>
+ vnoremap <buffer> <silent> ][ <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sW')<CR>
+ let b:undo_ftplugin .= " | sil! exe 'nunmap <buffer> [[' | sil! exe 'vunmap <buffer> [['" .
+ \ " | sil! exe 'nunmap <buffer> ]]' | sil! exe 'vunmap <buffer> ]]'" .
+ \ " | sil! exe 'nunmap <buffer> []' | sil! exe 'vunmap <buffer> []'" .
+ \ " | sil! exe 'nunmap <buffer> ][' | sil! exe 'vunmap <buffer> ]['"
+endif
+
+" TODO: line start anchors are almost certainly overly restrictive - allow
+" after statement separators. Even in QuickBasic only block IF statements
+" were required to be at the start of a line.
+if exists("loaded_matchit") && !exists("b:match_words")
+ let b:match_ignorecase = 1
+ let b:match_words =
+ \ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*\%($\|''\):\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
+ \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
+ \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
+ \ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' .
+ \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
+ \ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' .
+ \ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' .
+ \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
+ \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
+ let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase"
+endif
-" NOTE the double escaping \\|
-nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'bW')<cr>
-nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'W')<cr>
-nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr>
-nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr>
-
-" matchit support
-if exists("loaded_matchit")
- let b:match_ignorecase=1
- let b:match_words=
- \ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*$:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
- \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
- \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
- \ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' .
- \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
- \ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' .
- \ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' .
- \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
- \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "Visual Basic Source Files (*.bas)\t*.bas\n" .
+ \ "Visual Basic Form Files (*.frm)\t*.frm\n" .
+ \ "All Files (*.*)\t*.*\n"
+ let b:undo_ftplugin .= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index ae0242a312..c5a9f503d5 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
-" Last Change: 2021 Nov 14
+" Last Change: 2021 Nov 21
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with
@@ -289,8 +289,9 @@ func s:StartDebug_term(dict)
call chansend(s:gdb_job_id, 'set args ' . join(proc_args) . "\r")
endif
- " Connect gdb to the communication pty, using the GDB/MI interface
- call chansend(s:gdb_job_id, 'new-ui mi ' . commpty . "\r")
+ " Connect gdb to the communication pty, using the GDB/MI interface.
+ " Prefix "server" to avoid adding this to the history.
+ call chansend(s:gdb_job_id, 'server new-ui mi ' . commpty . "\r")
" Wait for the response to show up, users may not notice the error and wonder
" why the debugger doesn't work.
@@ -309,7 +310,7 @@ func s:StartDebug_term(dict)
let response = line1 . line2
if response =~ 'Undefined command'
echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
- call s:CloseBuffers()
+ call s:CloseBuffers()
return
endif
if response =~ 'New UI allocated'
@@ -504,7 +505,7 @@ func TermDebugSendCommand(cmd)
" needed once.
call jobstop(s:gdbjob)
else
- call s:SendCommand('-exec-interrupt')
+ Stop
endif
sleep 10m
endif
@@ -595,14 +596,14 @@ func s:DecodeMessage(quotedText)
if a:quotedText[i] == '\'
let i += 1
if a:quotedText[i] == 'n'
- " drop \n
- let i += 1
- continue
+ " drop \n
+ let i += 1
+ continue
elseif a:quotedText[i] == 't'
- " append \t
- let i += 1
- let result .= "\t"
- continue
+ " append \t
+ let i += 1
+ let result .= "\t"
+ continue
endif
endif
let result .= a:quotedText[i]
@@ -657,8 +658,8 @@ func s:EndDebugCommon()
if bufexists(bufnr)
exe bufnr .. "buf"
if exists('b:save_signcolumn')
- let &signcolumn = b:save_signcolumn
- unlet b:save_signcolumn
+ let &signcolumn = b:save_signcolumn
+ unlet b:save_signcolumn
endif
endif
endfor
@@ -769,7 +770,7 @@ func s:CommOutput(job_id, msgs, event)
elseif msg != ''
if msg =~ '^\(\*stopped\|\*running\|=thread-selected\)'
call s:HandleCursor(msg)
- elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,'
+ elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,' || msg =~ '^=breakpoint-modified,'
call s:HandleNewBreakpoint(msg)
elseif msg =~ '^=breakpoint-deleted,'
call s:HandleBreakpointDelete(msg)
@@ -809,12 +810,15 @@ func s:InstallCommands()
command Finish call s:SendCommand('-exec-finish')
command -nargs=* Run call s:Run(<q-args>)
command -nargs=* Arguments call s:SendCommand('-exec-arguments ' . <q-args>)
- command Stop call s:SendCommand('-exec-interrupt')
- " using -exec-continue results in CTRL-C in gdb window not working
if s:way == 'prompt'
+ command Stop call s:PromptInterrupt()
command Continue call s:SendCommand('continue')
else
+ command Stop call s:SendCommand('-exec-interrupt')
+ " using -exec-continue results in CTRL-C in the gdb window not working,
+ " communicating via commbuf (= use of SendCommand) has the same result
+ "command Continue call s:SendCommand('-exec-continue')
command Continue call chansend(s:gdb_job_id, "continue\r")
endif
@@ -913,20 +917,16 @@ func s:SetBreakpoint(at)
let do_continue = 0
if !s:stopped
let do_continue = 1
- if s:way == 'prompt'
- call s:PromptInterrupt()
- else
- call s:SendCommand('-exec-interrupt')
- endif
+ Stop
sleep 10m
endif
" Use the fname:lnum format, older gdb can't handle --source.
let at = empty(a:at) ?
- \ fnameescape(expand('%:p')) . ':' . line('.') : a:at
+ \ fnameescape(expand('%:p')) . ':' . line('.') : a:at
call s:SendCommand('-break-insert ' . at)
if do_continue
- call s:SendCommand('-exec-continue')
+ Continue
endif
endfunc
@@ -937,23 +937,32 @@ func s:ClearBreakpoint()
let bploc = printf('%s:%d', fname, lnum)
if has_key(s:breakpoint_locations, bploc)
let idx = 0
+ let nr = 0
for id in s:breakpoint_locations[bploc]
if has_key(s:breakpoints, id)
- " Assume this always works, the reply is simply "^done".
- call s:SendCommand('-break-delete ' . id)
- for subid in keys(s:breakpoints[id])
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
- endfor
- unlet s:breakpoints[id]
- unlet s:breakpoint_locations[bploc][idx]
- break
+ " Assume this always works, the reply is simply "^done".
+ call s:SendCommand('-break-delete ' . id)
+ for subid in keys(s:breakpoints[id])
+ exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ endfor
+ unlet s:breakpoints[id]
+ unlet s:breakpoint_locations[bploc][idx]
+ let nr = id
+ break
else
- let idx += 1
+ let idx += 1
endif
endfor
- if empty(s:breakpoint_locations[bploc])
- unlet s:breakpoint_locations[bploc]
+ if nr != 0
+ if empty(s:breakpoint_locations[bploc])
+ unlet s:breakpoint_locations[bploc]
+ endif
+ echomsg 'Breakpoint ' . id . ' cleared from line ' . lnum . '.'
+ else
+ echoerr 'Internal error trying to remove breakpoint at line ' . lnum . '!'
endif
+ else
+ echomsg 'No breakpoint to remove at line ' . lnum . '.'
endif
endfunc
@@ -965,44 +974,72 @@ func s:Run(args)
endfunc
func s:SendEval(expr)
- " clean up expression that may got in because of range
- " (newlines and surrounding spaces)
- let expr = a:expr
- if &filetype ==# 'cobol'
- " extra cleanup for COBOL: _every: expression ends with a period,
- " a trailing comma is ignored as it commonly separates multiple expr.
- let expr = substitute(expr, '\..*', '', '')
- let expr = substitute(expr, '[;\n]', ' ', 'g')
- let expr = substitute(expr, ',*$', '', '')
+ " check for "likely" boolean expressions, in which case we take it as lhs
+ if a:expr =~ "[=!<>]="
+ let exprLHS = a:expr
else
- let expr = substitute(expr, '\n', ' ', 'g')
+ " remove text that is likely an assignment
+ let exprLHS = substitute(a:expr, ' *=.*', '', '')
endif
- let expr = substitute(expr, '^ *\(.*\) *', '\1', '')
+ " encoding expression to prevent bad errors
+ let expr = a:expr
+ let expr = substitute(expr, '\\', '\\\\', 'g')
+ let expr = substitute(expr, '"', '\\"', 'g')
call s:SendCommand('-data-evaluate-expression "' . expr . '"')
- let s:evalexpr = expr
+ let s:evalexpr = exprLHS
endfunc
-" :Evaluate - evaluate what is under the cursor
+" :Evaluate - evaluate what is specified / under the cursor
func s:Evaluate(range, arg)
+ let expr = s:GetEvaluationExpression(a:range, a:arg)
+ let s:ignoreEvalError = 0
+ call s:SendEval(expr)
+endfunc
+
+" get what is specified / under the cursor
+func s:GetEvaluationExpression(range, arg)
if a:arg != ''
- let expr = a:arg
- let s:evalFromBalloonExpr = 0
+ " user supplied evaluation
+ let expr = s:CleanupExpr(a:arg)
+ " DSW: replace "likely copy + paste" assignment
+ let expr = substitute(expr, '"\([^"]*\)": *', '\1=', 'g')
elseif a:range == 2
let pos = getcurpos()
let reg = getreg('v', 1, 1)
let regt = getregtype('v')
normal! gv"vy
- let expr = @v
+ let expr = s:CleanupExpr(@v)
call setpos('.', pos)
call setreg('v', reg, regt)
let s:evalFromBalloonExpr = 1
else
+ " no evaluation provided: get from C-expression under cursor
+ " TODO: allow filetype specific lookup #9057
let expr = expand('<cexpr>')
let s:evalFromBalloonExpr = 1
endif
- let s:ignoreEvalError = 0
- call s:SendEval(expr)
+ return expr
+endfunc
+
+" clean up expression that may got in because of range
+" (newlines and surrounding whitespace)
+func s:CleanupExpr(expr)
+ " replace all embedded newlines/tabs/...
+ let expr = substitute( a:expr, '\s', ' ', 'g')
+
+ if &filetype ==# 'cobol'
+ " extra cleanup for COBOL: _every: expression ends with a period,
+ " a semicolon nmay be used instead of a space
+ " a trailing comma is ignored as it commonly separates multiple expr
+ let expr = substitute(expr, '\..*', '', '')
+ let expr = substitute(expr, ';', ' ', 'g')
+ let expr = substitute(expr, ',*$', '', '')
+ endif
+
+ " get rid of surrounding spaces
+ let expr = substitute(expr, '^ *\(.*\) *', '\1', '')
+ return expr
endfunc
let s:ignoreEvalError = 0
@@ -1246,15 +1283,15 @@ func s:HandleCursor(msg)
let curwinid = win_getid(winnr())
if win_gotoid(s:asmwin)
- let lnum = search('^' . s:asm_addr)
- if lnum == 0
- call s:SendCommand('disassemble $pc')
- else
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
- endif
+ let lnum = search('^' . s:asm_addr)
+ if lnum == 0
+ call s:SendCommand('disassemble $pc')
+ else
+ exe 'sign unplace ' . s:asm_id
+ exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ endif
- call win_gotoid(curwinid)
+ call win_gotoid(curwinid)
endif
endif
endif
@@ -1278,8 +1315,8 @@ func s:HandleCursor(msg)
exe 'sign unplace ' . s:pc_id
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
if !exists('b:save_signcolumn')
- let b:save_signcolumn = &signcolumn
- call add(s:signcolumn_buflist, bufnr())
+ let b:save_signcolumn = &signcolumn
+ call add(s:signcolumn_buflist, bufnr())
endif
setlocal signcolumn=yes
endif
@@ -1308,7 +1345,12 @@ endfunction
" Will update the sign that shows the breakpoint
func s:HandleNewBreakpoint(msg)
if a:msg !~ 'fullname='
- " a watch does not have a file name
+ " a watch or a pending breakpoint does not have a file name
+ if a:msg =~ 'pending='
+ let nr = substitute(a:msg, '.*number=\"\([0-9.]*\)\".*', '\1', '')
+ let target = substitute(a:msg, '.*pending=\"\([^"]*\)\".*', '\1', '')
+ echomsg 'Breakpoint ' . nr . ' (' . target . ') pending.'
+ endif
return
endif
for msg in s:SplitMsg(a:msg)
@@ -1352,6 +1394,7 @@ func s:HandleNewBreakpoint(msg)
if bufloaded(fname)
call s:PlaceSign(id, subid, entry)
endif
+ echomsg 'Breakpoint ' . nr . ' created at line ' . lnum . '.'
endfor
endfunc
@@ -1371,11 +1414,12 @@ func s:HandleBreakpointDelete(msg)
if has_key(s:breakpoints, id)
for [subid, entry] in items(s:breakpoints[id])
if has_key(entry, 'placed')
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
- unlet entry['placed']
+ exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ unlet entry['placed']
endif
endfor
unlet s:breakpoints[id]
+ echomsg 'Breakpoint ' . id . ' cleared.'
endif
endfunc
@@ -1396,7 +1440,7 @@ func s:BufRead()
for [id, entries] in items(s:breakpoints)
for [subid, entry] in items(entries)
if entry['fname'] == fname
- call s:PlaceSign(id, subid, entry)
+ call s:PlaceSign(id, subid, entry)
endif
endfor
endfor
@@ -1408,7 +1452,7 @@ func s:BufUnloaded()
for [id, entries] in items(s:breakpoints)
for [subid, entry] in items(entries)
if entry['fname'] == fname
- let entry['placed'] = 0
+ let entry['placed'] = 0
endif
endfor
endfor
diff --git a/runtime/syntax/indent.vim b/runtime/syntax/indent.vim
index ddeae67e0d..b2a1a0c85f 100644
--- a/runtime/syntax/indent.vim
+++ b/runtime/syntax/indent.vim
@@ -1,7 +1,8 @@
" Vim syntax file
-" Language: indent(1) configuration file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2010-01-23
+" Language: indent(1) configuration file
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 2021 Nov 17
" indent_is_bsd: If exists, will change somewhat to match BSD implementation
"
" TODO: is the deny-all (a la lilo.vim nice or no?)...
@@ -27,7 +28,7 @@ syn region indentComment start='//' skip='\\$' end='$'
\ contains=indentTodo,@Spell
if !exists("indent_is_bsd")
- syn match indentOptions '-i\|--indentation-level\|-il\|--indent-level'
+ syn match indentOptions '-i\|--indent-level\|-il\|--indent-label'
\ nextgroup=indentNumber skipwhite skipempty
endif
syn match indentOptions '-\%(bli\|c\%([bl]i\|[dip]\)\=\|di\=\|ip\=\|lc\=\|pp\=i\|sbi\|ts\|-\%(brace-indent\|comment-indentation\|case-brace-indentation\|declaration-comment-column\|continuation-indentation\|case-indentation\|else-endif-column\|line-comments-indentation\|declaration-indentation\|indent-level\|parameter-indentation\|line-length\|comment-line-length\|paren-indentation\|preprocessor-indentation\|struct-brace-indentation\|tab-size\)\)'