aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-04 19:18:16 -0400
committerGitHub <noreply@github.com>2021-05-04 19:18:16 -0400
commit4ad30f775e5564c539324b4818886f067d2ecd99 (patch)
tree97a554379bda7e5fc77e58c690db3f5a72db8c74 /runtime/pack
parent63d8a8f4e8b02e524d85aed08aa16c5d9815598c (diff)
parentd5b063aec1db95704b37a77fdbd968cb6b48cc3b (diff)
downloadrneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.gz
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.bz2
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.zip
Merge pull request #14424 from janlazo/vim-8.1.1726
vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
Diffstat (limited to 'runtime/pack')
-rw-r--r--runtime/pack/dist/opt/matchit/autoload/matchit.vim12
-rw-r--r--runtime/pack/dist/opt/matchit/doc/matchit.txt8
-rw-r--r--runtime/pack/dist/opt/matchit/plugin/matchit.vim16
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim104
4 files changed, 100 insertions, 40 deletions
diff --git a/runtime/pack/dist/opt/matchit/autoload/matchit.vim b/runtime/pack/dist/opt/matchit/autoload/matchit.vim
index abf06d3c4c..4f3dd8ff9e 100644
--- a/runtime/pack/dist/opt/matchit/autoload/matchit.vim
+++ b/runtime/pack/dist/opt/matchit/autoload/matchit.vim
@@ -1,6 +1,6 @@
" matchit.vim: (global plugin) Extended "%" matching
" autload script of matchit plugin, see ../plugin/matchit.vim
-" Last Change: 2019 Jan 28
+" Last Change: Mar 01, 2020
let s:last_mps = ""
let s:last_words = ":"
@@ -48,6 +48,8 @@ function matchit#Match_wrapper(word, forward, mode) range
execute "normal! gv\<Esc>"
elseif a:mode == "o" && mode(1) !~# '[vV]'
exe "norm! v"
+ elseif a:mode == "n" && mode(1) =~# 'ni'
+ exe "norm! v"
endif
" In s:CleanUp(), we may need to check whether the cursor moved forward.
let startpos = [line("."), col(".")]
@@ -211,6 +213,14 @@ function matchit#Match_wrapper(word, forward, mode) range
execute "if " . skip . "| let skip = '0' | endif"
endif
let sp_return = searchpair(ini, mid, fin, flag, skip)
+ if &selection isnot# 'inclusive' && a:mode == 'v'
+ " move cursor one pos to the right, because selection is not inclusive
+ " add virtualedit=onemore, to make it work even when the match ends the " line
+ if !(col('.') < col('$')-1)
+ set ve=onemore
+ endif
+ norm! l
+ endif
let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
" Restore cursor position and original screen.
call winrestview(view)
diff --git a/runtime/pack/dist/opt/matchit/doc/matchit.txt b/runtime/pack/dist/opt/matchit/doc/matchit.txt
index b2b78089a0..3cd2c8e2a7 100644
--- a/runtime/pack/dist/opt/matchit/doc/matchit.txt
+++ b/runtime/pack/dist/opt/matchit/doc/matchit.txt
@@ -4,7 +4,7 @@ For instructions on installing this file, type
`:help matchit-install`
inside Vim.
-For Vim version 8.1. Last change: 2019 May 05
+For Vim version 8.1. Last change: 2020 Mar 01
VIM REFERENCE MANUAL by Benji Fisher et al
@@ -377,6 +377,10 @@ The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in
==============================================================================
5. Known Bugs and Limitations *matchit-bugs*
+Repository: https://github.com/chrisbra/matchit/
+Bugs can be reported at the repository (alternatively you can send me a mail).
+The latest development snapshot can also be downloaded there.
+
Just because I know about a bug does not mean that it is on my todo list. I
try to respond to reports of bugs that cause real problems. If it does not
cause serious problems, or if there is a work-around, a bug may sit there for
@@ -388,4 +392,4 @@ try to implement this in a future version. (This is not so easy to arrange as
you might think!)
==============================================================================
-vim:tw=78:fo=tcq2:ft=help:
+vim:tw=78:ts=8:fo=tcq2:ft=help:
diff --git a/runtime/pack/dist/opt/matchit/plugin/matchit.vim b/runtime/pack/dist/opt/matchit/plugin/matchit.vim
index 84147f1fc8..b62cc3913a 100644
--- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim
+++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim
@@ -1,13 +1,13 @@
" matchit.vim: (global plugin) Extended "%" matching
" Maintainer: Christian Brabandt
-" Version: 1.15
-" Last Change: 2019 Jan 28
+" Version: 1.17
+" Last Change: 2019 Oct 24
" Repository: https://github.com/chrisbra/matchit
" Previous URL:http://www.vim.org/script.php?script_id=39
" Previous Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Documentation:
-" The documentation is in a separate file: ../doc/matchit.txt .
+" The documentation is in a separate file: ../doc/matchit.txt
" Credits:
" Vim editor by Bram Moolenaar (Thanks, Bram!)
@@ -48,8 +48,8 @@ set cpo&vim
nnoremap <silent> <Plug>(MatchitNormalForward) :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
nnoremap <silent> <Plug>(MatchitNormalBackward) :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
-vnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>m'gv``
-vnoremap <silent> <Plug>(MatchitVisualBackward) :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
+xnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>m'gv``
+xnoremap <silent> <Plug>(MatchitVisualBackward) :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
onoremap <silent> <Plug>(MatchitOperationForward) :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
onoremap <silent> <Plug>(MatchitOperationBackward) :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
@@ -63,8 +63,8 @@ omap <silent> g% <Plug>(MatchitOperationBackward)
" Analogues of [{ and ]} using matching patterns:
nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>
nnoremap <silent> <Plug>(MatchitNormalMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>
-vnoremap <silent> <Plug>(MatchitVisualMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
-vnoremap <silent> <Plug>(MatchitVisualMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>m'gv``
+xnoremap <silent> <Plug>(MatchitVisualMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
+xnoremap <silent> <Plug>(MatchitVisualMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>m'gv``
onoremap <silent> <Plug>(MatchitOperationMultiBackward) :<C-U>call matchit#MultiMatch("bW", "o")<CR>
onoremap <silent> <Plug>(MatchitOperationMultiForward) :<C-U>call matchit#MultiMatch("W", "o")<CR>
@@ -76,7 +76,7 @@ omap <silent> [% <Plug>(MatchitOperationMultiBackward)
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
" text object:
-vmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
+xmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
xmap a% <Plug>(MatchitVisualTextObject)
" Call this function to turn on debugging information. Every time the main
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index fa5d064048..a62df1dcec 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 Update: 2018 Jun 3
+" Last Change: 2021 Jan 03
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with
@@ -131,7 +131,11 @@ func s:StartDebug_internal(dict)
" call ch_logfile('debuglog', 'w')
let s:sourcewin = win_getid(winnr())
- let s:startsigncolumn = &signcolumn
+
+ " Remember the old value of 'signcolumn' for each buffer that it's set in, so
+ " that we can restore the value for all buffers.
+ let b:save_signcolumn = &signcolumn
+ let s:signcolumn_buflist = [bufnr()]
let s:save_columns = 0
let s:allleft = 0
@@ -292,7 +296,7 @@ func s:StartDebug_term(dict)
sleep 10m
endwhile
- " Interpret commands while the target is running. This should usualy only be
+ " Interpret commands while the target is running. This should usually only be
" exec-interrupt, since many commands don't work properly while the target is
" running.
call s:SendCommand('-gdb-set mi-async on')
@@ -348,7 +352,7 @@ func s:StartDebug_prompt(dict)
return
endif
- " Interpret commands while the target is running. This should usualy only
+ " Interpret commands while the target is running. This should usually only
" be exec-interrupt, since many commands don't work properly while the
" target is running.
call s:SendCommand('-gdb-set mi-async on')
@@ -552,9 +556,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
endif
endif
let result .= a:quotedText[i]
@@ -598,8 +607,20 @@ func s:EndDebugCommon()
exe 'bwipe! ' . s:ptybuf
endif
+ " Restore 'signcolumn' in all buffers for which it was set.
call win_gotoid(s:sourcewin)
- let &signcolumn = s:startsigncolumn
+ let was_buf = bufnr()
+ for bufnr in s:signcolumn_buflist
+ if bufexists(bufnr)
+ exe bufnr .. "buf"
+ if exists('b:save_signcolumn')
+ let &signcolumn = b:save_signcolumn
+ unlet b:save_signcolumn
+ endif
+ endif
+ endfor
+ exe was_buf .. "buf"
+
call s:DeleteCommands()
call win_gotoid(curwinid)
@@ -715,12 +736,22 @@ func s:CommOutput(job_id, msgs, event)
endfor
endfunc
+func s:GotoProgram()
+ if has('win32')
+ if executable('powershell')
+ call system(printf('powershell -Command "add-type -AssemblyName microsoft.VisualBasic;[Microsoft.VisualBasic.Interaction]::AppActivate(%d);"', s:pid))
+ endif
+ else
+ call win_gotoid(s:ptywin)
+ endif
+endfunc
+
" Install commands in the current window to control the debugger.
func s:InstallCommands()
let save_cpo = &cpo
set cpo&vim
- command Break call s:SetBreakpoint()
+ command -nargs=? Break call s:SetBreakpoint(<q-args>)
command Clear call s:ClearBreakpoint()
command Step call s:SendCommand('-exec-step')
command Over call s:SendCommand('-exec-next')
@@ -738,13 +769,15 @@ func s:InstallCommands()
command -range -nargs=* Evaluate call s:Evaluate(<range>, <q-args>)
command Gdb call win_gotoid(s:gdbwin)
- command Program call win_gotoid(s:ptywin)
+ command Program call s:GotoProgram()
command Source call s:GotoSourcewinOrCreateIt()
command Asm call s:GotoAsmwinOrCreateIt()
command Winbar call s:InstallWinbar()
- " TODO: can the K mapping be restored?
- nnoremap K :Evaluate<CR>
+ if !exists('g:termdebug_map_K') || g:termdebug_map_K
+ let s:k_map_saved = maparg('K', 'n', 0, 1)
+ nnoremap K :Evaluate<CR>
+ endif
let &cpo = save_cpo
endfunc
@@ -782,7 +815,14 @@ func s:DeleteCommands()
delcommand Asm
delcommand Winbar
- nunmap K
+ if exists('s:k_map_saved')
+ if empty(s:k_map_saved)
+ nunmap K
+ else
+ call mapset('n', 0, s:k_map_saved)
+ endif
+ unlet s:k_map_saved
+ endif
exe 'sign unplace ' . s:pc_id
for [id, entries] in items(s:breakpoints)
@@ -801,7 +841,7 @@ func s:DeleteCommands()
endfunc
" :Break - Set a breakpoint at the cursor position.
-func s:SetBreakpoint()
+func s:SetBreakpoint(at)
" Setting a breakpoint may not work while the program is running.
" Interrupt to make it work.
let do_continue = 0
@@ -814,9 +854,11 @@ func s:SetBreakpoint()
endif
sleep 10m
endif
+
" Use the fname:lnum format, older gdb can't handle --source.
- call s:SendCommand('-break-insert '
- \ . fnameescape(expand('%:p')) . ':' . line('.'))
+ let at = empty(a:at) ?
+ \ fnameescape(expand('%:p')) . ':' . line('.') : a:at
+ call s:SendCommand('-break-insert ' . at)
if do_continue
call s:SendCommand('-exec-continue')
endif
@@ -831,14 +873,14 @@ func s:ClearBreakpoint()
let idx = 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]
+ break
else
let idx += 1
endif
@@ -1152,6 +1194,10 @@ func s:HandleCursor(msg)
exe lnum
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())
+ endif
setlocal signcolumn=yes
endif
elseif !s:stopped || fname != ''
@@ -1228,7 +1274,7 @@ endfunc
func s:PlaceSign(id, subid, entry)
let nr = printf('%d.%d', a:id, a:subid)
- exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' file=' . a:entry['fname']
+ exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' priority=110 file=' . a:entry['fname']
let a:entry['placed'] = 1
endfunc
@@ -1242,8 +1288,8 @@ 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]
@@ -1267,7 +1313,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
@@ -1279,7 +1325,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