Mercurial > vim
comparison src/gui_beval.c @ 6297:488bb7c4ace0 v7.4.482
updated for version 7.4.482
Problem: When 'balloonexpr' results in a list, the text has a trailing
newline. (Lcd)
Solution: Remove one trailing newline.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 21 Oct 2014 14:15:17 +0200 |
parents | 8dcc6f142460 |
children | a1e71a01dbd6 |
comparison
equal
deleted
inserted
replaced
6296:575e8caa46a2 | 6297:488bb7c4ace0 |
---|---|
28 char_u *text; | 28 char_u *text; |
29 static char_u *result = NULL; | 29 static char_u *result = NULL; |
30 long winnr = 0; | 30 long winnr = 0; |
31 char_u *bexpr; | 31 char_u *bexpr; |
32 buf_T *save_curbuf; | 32 buf_T *save_curbuf; |
33 size_t len; | |
33 # ifdef FEAT_WINDOWS | 34 # ifdef FEAT_WINDOWS |
34 win_T *cw; | 35 win_T *cw; |
35 # endif | 36 # endif |
36 #endif | 37 #endif |
37 static int recursive = FALSE; | 38 static int recursive = FALSE; |
80 ++sandbox; | 81 ++sandbox; |
81 ++textlock; | 82 ++textlock; |
82 | 83 |
83 vim_free(result); | 84 vim_free(result); |
84 result = eval_to_string(bexpr, NULL, TRUE); | 85 result = eval_to_string(bexpr, NULL, TRUE); |
86 | |
87 /* Remove one trailing newline, it is added when the result was a | |
88 * list and it's hardly every useful. If the user really wants a | |
89 * trailing newline he can add two and one remains. */ | |
90 if (result != NULL) | |
91 { | |
92 len = STRLEN(result); | |
93 if (len > 0 && result[len - 1] == NL) | |
94 result[len - 1] = NUL; | |
95 } | |
85 | 96 |
86 if (use_sandbox) | 97 if (use_sandbox) |
87 --sandbox; | 98 --sandbox; |
88 --textlock; | 99 --textlock; |
89 | 100 |