summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2006-10-17 14:25:24 +0000
committervimboss <devnull@localhost>2006-10-17 14:25:24 +0000
commitf373996edec5018310d6036c75a204ab8e6ff073 (patch)
tree507b6713eac6d1c88d2b32d144f729b053293f2b
parent125a00bb6f5cccebd74ff60d31645494d2554825 (diff)
downloadvim-f373996edec5018310d6036c75a204ab8e6ff073.tar.gz
updated for version 7.0-141v7.0.141v7-0-141
-rw-r--r--src/ex_getln.c15
-rw-r--r--src/ops.c12
-rw-r--r--src/proto/ops.pro2
-rw-r--r--src/version.c2
4 files changed, 20 insertions, 11 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 4244a12e..030be38e 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -86,7 +86,7 @@ static int realloc_cmdbuff __ARGS((int len));
static void draw_cmdline __ARGS((int start, int len));
static void save_cmdline __ARGS((struct cmdline_info *ccp));
static void restore_cmdline __ARGS((struct cmdline_info *ccp));
-static int cmdline_paste __ARGS((int regname, int literally));
+static int cmdline_paste __ARGS((int regname, int literally, int remcr));
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
static void redrawcmd_preedit __ARGS((void));
#endif
@@ -1116,7 +1116,7 @@ getcmdline(firstc, count, indent)
#endif
if (c != ESC) /* use ESC to cancel inserting register */
{
- cmdline_paste(c, i == Ctrl_R);
+ cmdline_paste(c, i == Ctrl_R, FALSE);
#ifdef FEAT_EVAL
/* When there was a serious error abort getting the
@@ -1231,16 +1231,16 @@ getcmdline(firstc, count, indent)
goto cmdline_not_changed; /* Ignore mouse */
# ifdef FEAT_CLIPBOARD
if (clip_star.available)
- cmdline_paste('*', TRUE);
+ cmdline_paste('*', TRUE, TRUE);
else
# endif
- cmdline_paste(0, TRUE);
+ cmdline_paste(0, TRUE, TRUE);
redrawcmd();
goto cmdline_changed;
# ifdef FEAT_DND
case K_DROP:
- cmdline_paste('~', TRUE);
+ cmdline_paste('~', TRUE, FALSE);
redrawcmd();
goto cmdline_changed;
# endif
@@ -2890,9 +2890,10 @@ restore_cmdline_alloc(p)
* return FAIL for failure, OK otherwise
*/
static int
-cmdline_paste(regname, literally)
+cmdline_paste(regname, literally, remcr)
int regname;
int literally; /* Insert text literally instead of "as typed" */
+ int remcr; /* remove trailing CR */
{
long i;
char_u *arg;
@@ -2968,7 +2969,7 @@ cmdline_paste(regname, literally)
return OK;
}
- return cmdline_paste_reg(regname, literally);
+ return cmdline_paste_reg(regname, literally, remcr);
}
/*
diff --git a/src/ops.c b/src/ops.c
index be7091f4..4f45aea4 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1480,9 +1480,10 @@ get_spec_reg(regname, argp, allocated, errmsg)
* return FAIL for failure, OK otherwise
*/
int
-cmdline_paste_reg(regname, literally)
+cmdline_paste_reg(regname, literally, remcr)
int regname;
int literally; /* Insert text literally instead of "as typed" */
+ int remcr; /* don't add trailing CR */
{
long i;
@@ -1494,8 +1495,13 @@ cmdline_paste_reg(regname, literally)
{
cmdline_paste_str(y_current->y_array[i], literally);
- /* insert ^M between lines and after last line if type is MLINE */
- if (y_current->y_type == MLINE || i < y_current->y_size - 1)
+ /* Insert ^M between lines and after last line if type is MLINE.
+ * Don't do this when "remcr" is TRUE and the next line is empty. */
+ if (y_current->y_type == MLINE
+ || (i < y_current->y_size - 1
+ && !(remcr
+ && i == y_current->y_size - 2
+ && *y_current->y_array[i + 1] == NUL)))
cmdline_paste_str((char_u *)"\r", literally);
/* Check for CTRL-C, in case someone tries to paste a few thousand
diff --git a/src/proto/ops.pro b/src/proto/ops.pro
index d6216b9a..881f9aeb 100644
--- a/src/proto/ops.pro
+++ b/src/proto/ops.pro
@@ -20,7 +20,7 @@ extern int do_record __ARGS((int c));
extern int do_execreg __ARGS((int regname, int colon, int addcr));
extern int insert_reg __ARGS((int regname, int literally));
extern int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
-extern int cmdline_paste_reg __ARGS((int regname, int literally));
+extern int cmdline_paste_reg __ARGS((int regname, int literally, int remcr));
extern void adjust_clip_reg __ARGS((int *rp));
extern int op_delete __ARGS((oparg_T *oap));
extern int op_replace __ARGS((oparg_T *oap, int c));
diff --git a/src/version.c b/src/version.c
index eae09360..ff01a2b5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 141,
+/**/
140,
/**/
139,