]>
Commit | Line | Data |
---|---|---|
be561239 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.3.029 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 6.3.029 | |
11 | Problem: Crash when inserting a line break. (Walter Briscoe) | |
12 | Solution: In the syntax highlighting code, don't use an old state after a | |
13 | change was made, current_col may be past the end of the line. | |
14 | Files: src/syntax.c | |
15 | ||
16 | ||
17 | *** ../vim-6.3.028/src/syntax.c Mon Sep 13 16:36:12 2004 | |
18 | --- src/syntax.c Tue Oct 5 16:57:58 2004 | |
19 | *************** | |
20 | *** 437,453 **** | |
21 | linenr_T parsed_lnum; | |
22 | linenr_T first_stored; | |
23 | int dist; | |
24 | ||
25 | reg_syn = TRUE; /* let vim_regexec() know we're using syntax */ | |
26 | ||
27 | /* | |
28 | * After switching buffers, invalidate current_state. | |
29 | */ | |
30 | ! if (syn_buf != wp->w_buffer) | |
31 | { | |
32 | invalidate_current_state(); | |
33 | syn_buf = wp->w_buffer; | |
34 | } | |
35 | syn_win = wp; | |
36 | ||
37 | /* | |
38 | --- 437,457 ---- | |
39 | linenr_T parsed_lnum; | |
40 | linenr_T first_stored; | |
41 | int dist; | |
42 | + static int changedtick = 0; /* remember the last change ID */ | |
43 | ||
44 | reg_syn = TRUE; /* let vim_regexec() know we're using syntax */ | |
45 | ||
46 | /* | |
47 | * After switching buffers, invalidate current_state. | |
48 | + * Also do this when a change was made, the current state may be invalid | |
49 | + * then. | |
50 | */ | |
51 | ! if (syn_buf != wp->w_buffer || changedtick != syn_buf->b_changedtick) | |
52 | { | |
53 | invalidate_current_state(); | |
54 | syn_buf = wp->w_buffer; | |
55 | } | |
56 | + changedtick = syn_buf->b_changedtick; | |
57 | syn_win = wp; | |
58 | ||
59 | /* | |
60 | *** ../vim-6.3.028/src/version.c Sat Sep 18 21:13:25 2004 | |
61 | --- src/version.c Tue Oct 5 17:01:10 2004 | |
62 | *************** | |
63 | *** 643,644 **** | |
64 | --- 643,646 ---- | |
65 | { /* Add new patch number below this line */ | |
66 | + /**/ | |
67 | + 29, | |
68 | /**/ | |
69 | ||
70 | -- | |
71 | From "know your smileys": | |
72 | :-H Is missing teeth | |
73 | ||
74 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
75 | /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
76 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
77 | \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html /// |