summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-06-06 16:12:59 +0200
committerBram Moolenaar <Bram@vim.org>2012-06-06 16:12:59 +0200
commit8134039744ffa581f7c217df58131b709317c1c8 (patch)
treef8fd1cddb2359407b77c3b9a494a27a451e6378c /src/edit.c
parentbc256d91eadb8f32d6a5833c1878684d3c75fb2d (diff)
updated for version 7.3.541v7.3.541
Problem: When joining lines comment leaders need to be removed manually. Solution: Add the 'j' flag to 'formatoptions'. (Lech Lorens)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/edit.c b/src/edit.c
index ebecdb6ece..82e2b3b71d 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -5847,7 +5847,7 @@ insertchar(c, flags, second_indent)
* Need to remove existing (middle) comment leader and insert end
* comment leader. First, check what comment leader we can find.
*/
- i = get_leader_len(line = ml_get_curline(), &p, FALSE);
+ i = get_leader_len(line = ml_get_curline(), &p, FALSE, TRUE);
if (i > 0 && vim_strchr(p, COM_MIDDLE) != NULL) /* Just checking */
{
/* Skip middle-comment string */
@@ -6085,7 +6085,7 @@ internal_format(textwidth, second_indent, flags, format_only, c)
/* Don't break until after the comment leader */
if (do_comments)
- leader_len = get_leader_len(ml_get_curline(), NULL, FALSE);
+ leader_len = get_leader_len(ml_get_curline(), NULL, FALSE, TRUE);
else
leader_len = 0;
@@ -6411,7 +6411,7 @@ auto_format(trailblank, prev_line)
/* With the 'c' flag in 'formatoptions' and 't' missing: only format
* comments. */
if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP)
- && get_leader_len(old, NULL, FALSE) == 0)
+ && get_leader_len(old, NULL, FALSE, TRUE) == 0)
return;
#endif
@@ -8565,7 +8565,7 @@ ins_del()
{
temp = curwin->w_cursor.col;
if (!can_bs(BS_EOL) /* only if "eol" included */
- || do_join(2, FALSE, TRUE) == FAIL)
+ || do_join(2, FALSE, TRUE, FALSE) == FAIL)
vim_beep();
else
curwin->w_cursor.col = temp;
@@ -8746,7 +8746,7 @@ ins_bs(c, mode, inserted_space_p)
ptr[len - 1] = NUL;
}
- (void)do_join(2, FALSE, FALSE);
+ (void)do_join(2, FALSE, FALSE, FALSE);
if (temp == NUL && gchar_cursor() != NUL)
inc_cursor();
}