Skip to content

Commit 6023f13

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 21c825c + 44c2bff commit 6023f13

51 files changed

Lines changed: 1140 additions & 690 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Filelist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ SRC_ALL = \
1212
src/arabic.c \
1313
src/arabic.h \
1414
src/ascii.h \
15+
src/beval.c \
16+
src/beval.h \
1517
src/blowfish.c \
1618
src/buffer.c \
1719
src/channel.c \
@@ -41,7 +43,6 @@ SRC_ALL = \
4143
src/gui.c \
4244
src/gui.h \
4345
src/gui_beval.c \
44-
src/gui_beval.h \
4546
src/hardcopy.c \
4647
src/hashtab.c \
4748
src/json.c \

runtime/doc/options.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 8.0. Last change: 2017 Nov 11
1+
*options.txt* For Vim version 8.0. Last change: 2017 Nov 18
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1132,7 +1132,16 @@ A jump table for the options with a short description can be found at |Q_op|.
11321132
{not in Vi}
11331133
{only available when compiled with the |+balloon_eval|
11341134
feature}
1135-
Switch on the |balloon-eval| functionality.
1135+
Switch on the |balloon-eval| functionality for the GUI.
1136+
1137+
*'balloonevalterm'* *'bevalterm'* *'noballoonevalterm'*
1138+
*'nobevalterm'*
1139+
'balloonevalterm' 'bevalterm' boolean (default off)
1140+
global
1141+
{not in Vi}
1142+
{only available when compiled with the
1143+
|+balloon_eval_term| feature}
1144+
Switch on the |balloon-eval| functionality for the terminal.
11361145

11371146
*'balloonexpr'* *'bexpr'*
11381147
'balloonexpr' 'bexpr' string (default "")
@@ -3544,6 +3553,8 @@ A jump table for the options with a short description can be found at |Q_op|.
35443553
systems without an fsync() implementation, this variable is always
35453554
off.
35463555
Also see 'swapsync' for controlling fsync() on swap files.
3556+
'fsync' also applies to |writefile()|, unless a flag is used to
3557+
overrule it.
35473558

35483559
*'fullscreen'* *'fu'* *'nofullscreen'* *'nofu'*
35493560
'fullscreen' 'fu' boolean (default off)
@@ -4067,7 +4078,7 @@ A jump table for the options with a short description can be found at |Q_op|.
40674078
toolbar, tabline, etc. Instead, the behavior is similar to
40684079
when the window is maximized and will adjust 'lines' and
40694080
'columns' to fit to the window. Without the 'k' flag Vim will
4070-
try to keep 'lines' and 'columns the same when adding and
4081+
try to keep 'lines' and 'columns' the same when adding and
40714082
removing GUI components.
40724083

40734084
*'guipty'* *'noguipty'*
@@ -8428,7 +8439,7 @@ A jump table for the options with a short description can be found at |Q_op|.
84288439
number, more intelligent detection process runs.
84298440
The "xterm2" value will be set if the xterm version is reported to be
84308441
from 95 to 276. The "sgr" value will be set if the xterm version is
8431-
277 or highter.
8442+
277 or highter and when Vim detects Mac Terminal.app or Iterm2.
84328443
If you do not want 'ttymouse' to be set to "xterm2" or "sgr"
84338444
automatically, set t_RV to an empty string: >
84348445
:set t_RV=

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ func s:StartDebug(cmd)
6969
endif
7070
let pty = job_info(term_getjob(s:ptybuf))['tty_out']
7171
let s:ptywin = win_getid(winnr())
72+
if vertical
73+
" Assuming the source code window will get a signcolumn, use two more
74+
" columns for that, thus one less for the terminal window.
75+
exe (&columns / 2 - 1) . "wincmd |"
76+
endif
7277

7378
" Create a hidden terminal window to communicate with gdb
7479
let s:commbuf = term_start('NONE', {
@@ -121,6 +126,15 @@ func s:StartDebug(cmd)
121126
call s:InstallCommands()
122127
call win_gotoid(s:gdbwin)
123128

129+
" Enable showing a balloon with eval info
130+
if has("balloon_eval")
131+
set ballooneval
132+
set balloonexpr=TermDebugBalloonExpr()
133+
if has("balloon_eval_term")
134+
set balloonevalterm
135+
endif
136+
endif
137+
124138
let s:breakpoints = {}
125139

126140
augroup TermDebug
@@ -144,6 +158,14 @@ func s:EndDebug(job, status)
144158
let &columns = s:save_columns
145159
endif
146160

161+
if has("balloon_eval")
162+
set noballooneval
163+
set balloonexpr=
164+
if has("balloon_eval_term")
165+
set noballoonevalterm
166+
endif
167+
endif
168+
147169
au! TermDebug
148170
endfunc
149171

@@ -279,6 +301,11 @@ func s:Run(args)
279301
call s:SendCommand('-exec-run')
280302
endfunc
281303

304+
func s:SendEval(expr)
305+
call s:SendCommand('-data-evaluate-expression "' . a:expr . '"')
306+
let s:evalexpr = a:expr
307+
endfunc
308+
282309
" :Evaluate - evaluate what is under the cursor
283310
func s:Evaluate(range, arg)
284311
if a:arg != ''
@@ -294,25 +321,54 @@ func s:Evaluate(range, arg)
294321
else
295322
let expr = expand('<cexpr>')
296323
endif
297-
call s:SendCommand('-data-evaluate-expression "' . expr . '"')
298-
let s:evalexpr = expr
324+
call s:SendEval(expr)
299325
endfunc
300326

327+
let s:evalFromBalloonExpr = 0
328+
301329
" Handle the result of data-evaluate-expression
302330
func s:HandleEvaluate(msg)
303331
let value = substitute(a:msg, '.*value="\(.*\)"', '\1', '')
304332
let value = substitute(value, '\\"', '"', 'g')
305-
echomsg '"' . s:evalexpr . '": ' . value
333+
if s:evalFromBalloonExpr
334+
if s:evalFromBalloonExprResult == ''
335+
let s:evalFromBalloonExprResult = s:evalexpr . ': ' . value
336+
else
337+
let s:evalFromBalloonExprResult .= ' = ' . value
338+
endif
339+
call balloon_show(s:evalFromBalloonExprResult)
340+
else
341+
echomsg '"' . s:evalexpr . '": ' . value
342+
endif
306343

307344
if s:evalexpr[0] != '*' && value =~ '^0x' && value != '0x0' && value !~ '"$'
308345
" Looks like a pointer, also display what it points to.
309-
let s:evalexpr = '*' . s:evalexpr
310-
call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . s:evalexpr . "\"\r")
346+
call s:SendEval('*' . s:evalexpr)
347+
else
348+
let s:evalFromBalloonExpr = 0
349+
endif
350+
endfunc
351+
352+
" Show a balloon with information of the variable under the mouse pointer,
353+
" if there is any.
354+
func TermDebugBalloonExpr()
355+
if v:beval_winid != s:startwin
356+
return
311357
endif
358+
call s:SendEval(v:beval_text)
359+
let s:evalFromBalloonExpr = 1
360+
let s:evalFromBalloonExprResult = ''
361+
return ''
312362
endfunc
313363

314364
" Handle an error.
315365
func s:HandleError(msg)
366+
if a:msg =~ 'No symbol .* in current context'
367+
\ || a:msg =~ 'Cannot access memory at address '
368+
\ || a:msg =~ 'Attempt to use a type name as an expression'
369+
" Result of s:SendEval() failed, ignore.
370+
return
371+
endif
316372
echoerr substitute(a:msg, '.*msg="\(.*\)"', '\1', '')
317373
endfunc
318374

src/Make_cyg_ming.mak

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os
642642
CUIOBJ = $(OUTDIR)/iscygpty.o
643643
OBJ = \
644644
$(OUTDIR)/arabic.o \
645+
$(OUTDIR)/beval.o \
645646
$(OUTDIR)/blowfish.o \
646647
$(OUTDIR)/buffer.o \
647648
$(OUTDIR)/charset.o \
@@ -920,8 +921,8 @@ endif
920921
###########################################################################
921922
INCL = vim.h alloc.h arabic.h ascii.h ex_cmds.h farsi.h feature.h globals.h \
922923
keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \
923-
spell.h structs.h term.h $(NBDEBUG_INCL)
924-
GUI_INCL = gui.h gui_beval.h
924+
spell.h structs.h term.h beval.h $(NBDEBUG_INCL)
925+
GUI_INCL = gui.h
925926
CUI_INCL = iscygpty.h
926927

927928
$(OUTDIR)/if_python.o: if_python.c if_py_both.h $(INCL)
@@ -946,6 +947,9 @@ $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
946947
$(OUTDIR)/gui.o: gui.c $(INCL) $(GUI_INCL)
947948
$(CC) -c $(CFLAGS) gui.c -o $(OUTDIR)/gui.o
948949

950+
$(OUTDIR)/beval.o: beval.c $(INCL) $(GUI_INCL)
951+
$(CC) -c $(CFLAGS) beval.c -o $(OUTDIR)/beval.o
952+
949953
$(OUTDIR)/gui_beval.o: gui_beval.c $(INCL) $(GUI_INCL)
950954
$(CC) -c $(CFLAGS) gui_beval.c -o $(OUTDIR)/gui_beval.o
951955

src/Make_mvc.mak

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,11 @@ CFLAGS = $(CFLAGS) /Zl /MTd
683683

684684
INCL = vim.h alloc.h arabic.h ascii.h ex_cmds.h farsi.h feature.h globals.h \
685685
keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \
686-
spell.h structs.h term.h $(NBDEBUG_INCL)
686+
spell.h structs.h term.h beval.h $(NBDEBUG_INCL)
687687

688688
OBJ = \
689689
$(OUTDIR)\arabic.obj \
690+
$(OUTDIR)\beval.obj \
690691
$(OUTDIR)\blowfish.obj \
691692
$(OUTDIR)\buffer.obj \
692693
$(OUTDIR)\charset.obj \
@@ -781,8 +782,7 @@ CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
781782
RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
782783
VIM = g$(VIM)
783784
GUI_INCL = \
784-
gui.h \
785-
gui_beval.h
785+
gui.h
786786
GUI_OBJ = \
787787
$(OUTDIR)\gui.obj \
788788
$(OUTDIR)\gui_beval.obj \
@@ -1297,6 +1297,8 @@ testclean:
12971297

12981298
$(OUTDIR)/arabic.obj: $(OUTDIR) arabic.c $(INCL)
12991299

1300+
$(OUTDIR)/beval.obj: $(OUTDIR) beval.c $(INCL)
1301+
13001302
$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
13011303

13021304
$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)

0 commit comments

Comments
 (0)