summaryrefslogtreecommitdiffstats
path: root/runtime/pack
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-16 14:46:06 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-16 14:46:06 +0000
commitfd31be29b8220ee1cb0b3460c82f2634ae3cc370 (patch)
tree93ad5a4e32bbbbd52b42226ffdf05c4b03f10b6e /runtime/pack
parentc81e9bf4f07d350b860b934aa6bf0c2a7c91d07e (diff)
Update runtime files
Diffstat (limited to 'runtime/pack')
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim16
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index d288af1797..fde59df3d7 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 Dec 16
+" Last Change: 2022 Jan 13
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with
@@ -1252,8 +1252,17 @@ func s:HandleCursor(msg)
if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname)
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
if lnum =~ '^[0-9]*$'
- call s:GotoSourcewinOrCreateIt()
+ call s:GotoSourcewinOrCreateIt()
if expand('%:p') != fnamemodify(fname, ':p')
+ augroup Termdebug
+ " Always open a file read-only instead of showing the ATTENTION
+ " prompt, since we are unlikely to want to edit the file.
+ " The file may be changed but not saved, warn for that.
+ au SwapExists * echohl WarningMsg
+ \ | echo 'Warning: file is being edited elsewhere'
+ \ | echohl None
+ \ | let v:swapchoice = '0'
+ augroup END
if &modified
" TODO: find existing window
exe 'split ' . fnameescape(fname)
@@ -1262,6 +1271,9 @@ func s:HandleCursor(msg)
else
exe 'edit ' . fnameescape(fname)
endif
+ augroup Termdebug
+ au! SwapExists
+ augroup END
endif
exe lnum
normal! zv