summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.2.224
blob: d988eedad7f3bd186c537c82a7efda91fd174dd8 (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
To: vim-dev@vim.org
Subject: Patch 7.2.224
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.2.224
Problem:    Crash when using 'completefunc'. (Ingo Karkat)
Solution:   Disallow entering edit() recursively when doing completion.
Files:	    src/edit.c


*** ../vim-7.2.223/src/edit.c	2009-05-26 11:01:43.000000000 +0200
--- src/edit.c	2009-07-09 18:01:49.000000000 +0200
***************
*** 114,119 ****
--- 114,123 ----
   * FALSE the word to be completed must be located. */
  static int	  compl_started = FALSE;
  
+ /* Set when doing something for completion that may call edit() recursively,
+  * which is not allowed. */
+ static int	  compl_busy = FALSE;
+ 
  static int	  compl_matches = 0;
  static char_u	  *compl_pattern = NULL;
  static int	  compl_direction = FORWARD;
***************
*** 346,352 ****
  
  #ifdef FEAT_INS_EXPAND
      /* Don't allow recursive insert mode when busy with completion. */
!     if (compl_started || pum_visible())
      {
  	EMSG(_(e_secure));
  	return FALSE;
--- 350,356 ----
  
  #ifdef FEAT_INS_EXPAND
      /* Don't allow recursive insert mode when busy with completion. */
!     if (compl_started || compl_busy || pum_visible())
      {
  	EMSG(_(e_secure));
  	return FALSE;
***************
*** 1340,1347 ****
--- 1344,1353 ----
  		goto normalchar;
  
  docomplete:
+ 	    compl_busy = TRUE;
  	    if (ins_complete(c) == FAIL)
  		compl_cont_status = 0;
+ 	    compl_busy = FALSE;
  	    break;
  #endif /* FEAT_INS_EXPAND */
  
***************
*** 3172,3177 ****
--- 3178,3184 ----
  	vim_free(match);
      } while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
      compl_first_match = compl_curr_match = NULL;
+     compl_shown_match = NULL;
  }
  
      static void
*** ../vim-7.2.223/src/version.c	2009-07-09 15:55:34.000000000 +0200
--- src/version.c	2009-07-09 18:14:16.000000000 +0200
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     224,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
77. The phone company asks you to test drive their new PBX system

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///