Mercurial > vim
comparison src/eval.c @ 3000:02f5abca10ae v7.3.272
updated for version 7.3.272
Problem: ":put =list" does not add an empty line for a trailing empty
item.
Solution: Add a trailing NL when turning a list into a string.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 10 Aug 2011 12:38:08 +0200 |
parents | 1eb805225de7 |
children | 45ead8a0bede |
comparison
equal
deleted
inserted
replaced
2999:969b13e02b64 | 3000:02f5abca10ae |
---|---|
1355 { | 1355 { |
1356 if (convert && tv.v_type == VAR_LIST) | 1356 if (convert && tv.v_type == VAR_LIST) |
1357 { | 1357 { |
1358 ga_init2(&ga, (int)sizeof(char), 80); | 1358 ga_init2(&ga, (int)sizeof(char), 80); |
1359 if (tv.vval.v_list != NULL) | 1359 if (tv.vval.v_list != NULL) |
1360 { | |
1360 list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0); | 1361 list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0); |
1362 if (tv.vval.v_list->lv_len > 0) | |
1363 ga_append(&ga, NL); | |
1364 } | |
1361 ga_append(&ga, NUL); | 1365 ga_append(&ga, NUL); |
1362 retval = (char_u *)ga.ga_data; | 1366 retval = (char_u *)ga.ga_data; |
1363 } | 1367 } |
1364 #ifdef FEAT_FLOAT | 1368 #ifdef FEAT_FLOAT |
1365 else if (convert && tv.v_type == VAR_FLOAT) | 1369 else if (convert && tv.v_type == VAR_FLOAT) |