summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.199
blob: d421df0af23eaa0f5eaf43c2dec1bf98e2b53bf6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
To: vim_dev@googlegroups.com
Subject: Patch 7.4.199
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.199
Problem:    (issue 197) ]P doesn't paste over Visual selection.
Solution:   Handle Visual mode specifically. (Christian Brabandt)
Files:	    src/normal.c


*** ../vim-7.4.198/src/normal.c	2014-02-23 23:38:58.824760280 +0100
--- src/normal.c	2014-03-12 17:33:28.184831049 +0100
***************
*** 6751,6760 ****
      {
  	if (!checkclearop(cap->oap))
  	{
  	    prep_redo_cmd(cap);
! 	    do_put(cap->oap->regname,
! 	      (cap->cmdchar == ']' && cap->nchar == 'p') ? FORWARD : BACKWARD,
! 						  cap->count1, PUT_FIXINDENT);
  	}
      }
  
--- 6751,6808 ----
      {
  	if (!checkclearop(cap->oap))
  	{
+ 	    int	    dir = (cap->cmdchar == ']' && cap->nchar == 'p')
+ 							 ? FORWARD : BACKWARD;
+ 	    int	    regname = cap->oap->regname;
+ #ifdef FEAT_VISUAL
+ 	    int	    was_visual = VIsual_active;
+ 	    int	    line_count = curbuf->b_ml.ml_line_count;
+ 	    pos_T   start, end;
+ 
+ 	    if (VIsual_active)
+ 	    {
+ 		start = ltoreq(VIsual, curwin->w_cursor)
+ 						  ? VIsual : curwin->w_cursor;
+ 		end =  equalpos(start,VIsual) ? curwin->w_cursor : VIsual;
+ 		curwin->w_cursor = (dir == BACKWARD ? start : end);
+ 	    }
+ #endif
+ # ifdef FEAT_CLIPBOARD
+ 	    adjust_clip_reg(&regname);
+ # endif
  	    prep_redo_cmd(cap);
! 
! 	    do_put(regname, dir, cap->count1, PUT_FIXINDENT);
! #ifdef FEAT_VISUAL
! 	    if (was_visual)
! 	    {
! 		VIsual = start;
! 		curwin->w_cursor = end;
! 		if (dir == BACKWARD)
! 		{
! 		    /* adjust lines */
! 		    VIsual.lnum += curbuf->b_ml.ml_line_count - line_count;
! 		    curwin->w_cursor.lnum +=
! 				      curbuf->b_ml.ml_line_count - line_count;
! 		}
! 
! 		VIsual_active = TRUE;
! 		if (VIsual_mode == 'V')
! 		{
! 		    /* delete visually selected lines */
! 		    cap->cmdchar = 'd';
! 		    cap->nchar = NUL;
! 		    cap->oap->regname = regname;
! 		    nv_operator(cap);
! 		    do_pending_operator(cap, 0, FALSE);
! 		}
! 		if (VIsual_active)
! 		{
! 		    end_visual_mode();
! 		    redraw_later(SOME_VALID);
! 		}
! 	    }
! #endif
  	}
      }
  
*** ../vim-7.4.198/src/version.c	2014-03-12 17:08:01.508807656 +0100
--- src/version.c	2014-03-12 17:30:36.908828425 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     199,
  /**/

-- 
No man may purchase alcohol without written consent from his wife.
		[real standing law in Pennsylvania, United States of America]

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///