summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0992
blob: c0bcddbe5e6d4a82ef27d777bc2445c2a2221c31 (plain)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0992
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0992
Problem:    A :normal command while executing a register resets the
            reg_executing() result.
Solution:   Save and restore reg_executing. (closes #4066)
Files:	    src/ex_docmd.c, src/structs.h, src/testdir/test_functions.vim


*** ../vim-8.1.0991/src/ex_docmd.c	2019-02-17 17:44:36.203875545 +0100
--- src/ex_docmd.c	2019-03-04 11:25:11.856705429 +0100
***************
*** 10260,10265 ****
--- 10260,10266 ----
      sst->save_insertmode = p_im;
      sst->save_finish_op = finish_op;
      sst->save_opcount = opcount;
+     sst->save_reg_executing = reg_executing;
  
      msg_scroll = FALSE;	    /* no msg scrolling in Normal mode */
      restart_edit = 0;	    /* don't go to Insert mode */
***************
*** 10285,10290 ****
--- 10286,10292 ----
      p_im = sst->save_insertmode;
      finish_op = sst->save_finish_op;
      opcount = sst->save_opcount;
+     reg_executing = sst->save_reg_executing;
      msg_didout |= sst->save_msg_didout;	/* don't reset msg_didout now */
  
      /* Restore the state (needed when called from a function executed for
*** ../vim-8.1.0991/src/structs.h	2019-02-17 17:44:36.219875473 +0100
--- src/structs.h	2019-03-04 11:27:37.271660673 +0100
***************
*** 2625,2643 ****
   */
  struct frame_S
  {
!     char	fr_layout;	/* FR_LEAF, FR_COL or FR_ROW */
      int		fr_width;
!     int		fr_newwidth;	/* new width used in win_equal_rec() */
      int		fr_height;
!     int		fr_newheight;	/* new height used in win_equal_rec() */
!     frame_T	*fr_parent;	/* containing frame or NULL */
!     frame_T	*fr_next;	/* frame right or below in same parent, NULL
! 				   for first */
!     frame_T	*fr_prev;	/* frame left or above in same parent, NULL
! 				   for last */
!     /* fr_child and fr_win are mutually exclusive */
!     frame_T	*fr_child;	/* first contained frame */
!     win_T	*fr_win;	/* window that fills this frame */
  };
  
  #define FR_LEAF	0	/* frame is a leaf */
--- 2625,2643 ----
   */
  struct frame_S
  {
!     char	fr_layout;	// FR_LEAF, FR_COL or FR_ROW
      int		fr_width;
!     int		fr_newwidth;	// new width used in win_equal_rec()
      int		fr_height;
!     int		fr_newheight;	// new height used in win_equal_rec()
!     frame_T	*fr_parent;	// containing frame or NULL
!     frame_T	*fr_next;	// frame right or below in same parent, NULL
! 				// for last
!     frame_T	*fr_prev;	// frame left or above in same parent, NULL
! 				// for first
!     // fr_child and fr_win are mutually exclusive
!     frame_T	*fr_child;	// first contained frame
!     win_T	*fr_win;	// window that fills this frame
  };
  
  #define FR_LEAF	0	/* frame is a leaf */
***************
*** 3527,3532 ****
--- 3527,3533 ----
      int		save_insertmode;
      int		save_finish_op;
      int		save_opcount;
+     int		save_reg_executing;
      tasave_T	tabuf;
  } save_state_T;
  
*** ../vim-8.1.0991/src/testdir/test_functions.vim	2019-02-10 23:18:49.038187525 +0100
--- src/testdir/test_functions.vim	2019-03-04 11:37:13.379506401 +0100
***************
*** 1137,1142 ****
--- 1137,1151 ----
    call feedkeys("q\"\"=s:save_reg_stat()\<CR>pq", 'xt')
    call assert_equal('":', s:reg_stat)
  
+   " :normal command saves and restores reg_executing
+   let @q = ":call TestFunc()\<CR>:call s:save_reg_stat()\<CR>"
+   func TestFunc() abort
+     normal! ia
+   endfunc
+   call feedkeys("@q", 'xt')
+   call assert_equal(':q', s:reg_stat)
+   delfunc TestFunc
+ 
    bwipe!
    delfunc s:save_reg_stat
    unlet s:reg_stat
*** ../vim-8.1.0991/src/version.c	2019-03-03 14:42:04.782109771 +0100
--- src/version.c	2019-03-04 11:38:16.315045207 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     992,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
34. You laugh at people with a 10 Mbit connection.

 /// 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    ///