]>
Commit | Line | Data |
---|---|---|
ad28a8ff AG |
1 | To: vim-dev@vim.org |
2 | Subject: patch 7.1.005 | |
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 7.1.005 | |
11 | Problem: "cit" used on <foo></foo> deletes <foo>. Should not delete | |
12 | anything and start insertion, like "ci'" does on "". (Michal | |
13 | Bozon) | |
14 | Solution: Handle an empty object specifically. Made it work consistent for | |
15 | various text objects. | |
16 | Files: src/search.c | |
17 | ||
18 | ||
19 | *** ../vim-7.1.004/src/search.c Thu May 10 20:54:46 2007 | |
20 | --- src/search.c Mon Jun 4 12:31:04 2007 | |
21 | *************** | |
22 | *** 3600,3612 **** | |
23 | { | |
24 | oap->start = start_pos; | |
25 | oap->motion_type = MCHAR; | |
26 | if (sol) | |
27 | - { | |
28 | incl(&curwin->w_cursor); | |
29 | ! oap->inclusive = FALSE; | |
30 | ! } | |
31 | ! else | |
32 | oap->inclusive = TRUE; | |
33 | } | |
34 | ||
35 | return OK; | |
36 | --- 3600,3615 ---- | |
37 | { | |
38 | oap->start = start_pos; | |
39 | oap->motion_type = MCHAR; | |
40 | + oap->inclusive = FALSE; | |
41 | if (sol) | |
42 | incl(&curwin->w_cursor); | |
43 | ! else if (lt(start_pos, curwin->w_cursor)) | |
44 | ! /* Include the character under the cursor. */ | |
45 | oap->inclusive = TRUE; | |
46 | + else | |
47 | + /* End is before the start (no text in between <>, [], etc.): don't | |
48 | + * operate on any text. */ | |
49 | + curwin->w_cursor = start_pos; | |
50 | } | |
51 | ||
52 | return OK; | |
53 | *************** | |
54 | *** 3734,3740 **** | |
55 | ||
56 | if (in_html_tag(FALSE)) | |
57 | { | |
58 | ! /* cursor on start tag, move to just after it */ | |
59 | while (*ml_get_cursor() != '>') | |
60 | if (inc_cursor() < 0) | |
61 | break; | |
62 | --- 3737,3743 ---- | |
63 | ||
64 | if (in_html_tag(FALSE)) | |
65 | { | |
66 | ! /* cursor on start tag, move to its '>' */ | |
67 | while (*ml_get_cursor() != '>') | |
68 | if (inc_cursor() < 0) | |
69 | break; | |
70 | *************** | |
71 | *** 3838,3844 **** | |
72 | /* Exclude the start tag. */ | |
73 | curwin->w_cursor = start_pos; | |
74 | while (inc_cursor() >= 0) | |
75 | ! if (*ml_get_cursor() == '>' && lt(curwin->w_cursor, end_pos)) | |
76 | { | |
77 | inc_cursor(); | |
78 | start_pos = curwin->w_cursor; | |
79 | --- 3841,3847 ---- | |
80 | /* Exclude the start tag. */ | |
81 | curwin->w_cursor = start_pos; | |
82 | while (inc_cursor() >= 0) | |
83 | ! if (*ml_get_cursor() == '>') | |
84 | { | |
85 | inc_cursor(); | |
86 | start_pos = curwin->w_cursor; | |
87 | *************** | |
88 | *** 3860,3866 **** | |
89 | #ifdef FEAT_VISUAL | |
90 | if (VIsual_active) | |
91 | { | |
92 | ! if (*p_sel == 'e') | |
93 | ++curwin->w_cursor.col; | |
94 | VIsual = start_pos; | |
95 | VIsual_mode = 'v'; | |
96 | --- 3863,3873 ---- | |
97 | #ifdef FEAT_VISUAL | |
98 | if (VIsual_active) | |
99 | { | |
100 | ! /* If the end is before the start there is no text between tags, select | |
101 | ! * the char under the cursor. */ | |
102 | ! if (lt(end_pos, start_pos)) | |
103 | ! curwin->w_cursor = start_pos; | |
104 | ! else if (*p_sel == 'e') | |
105 | ++curwin->w_cursor.col; | |
106 | VIsual = start_pos; | |
107 | VIsual_mode = 'v'; | |
108 | *************** | |
109 | *** 3872,3878 **** | |
110 | { | |
111 | oap->start = start_pos; | |
112 | oap->motion_type = MCHAR; | |
113 | ! oap->inclusive = TRUE; | |
114 | } | |
115 | retval = OK; | |
116 | ||
117 | --- 3879,3893 ---- | |
118 | { | |
119 | oap->start = start_pos; | |
120 | oap->motion_type = MCHAR; | |
121 | ! if (lt(end_pos, start_pos)) | |
122 | ! { | |
123 | ! /* End is before the start: there is no text between tags; operate | |
124 | ! * on an empty area. */ | |
125 | ! curwin->w_cursor = start_pos; | |
126 | ! oap->inclusive = FALSE; | |
127 | ! } | |
128 | ! else | |
129 | ! oap->inclusive = TRUE; | |
130 | } | |
131 | retval = OK; | |
132 | ||
133 | *** ../vim-7.1.004/src/version.c Tue Jun 19 11:54:23 2007 | |
134 | --- src/version.c Tue Jun 19 12:57:03 2007 | |
135 | *************** | |
136 | *** 668,669 **** | |
137 | --- 668,671 ---- | |
138 | { /* Add new patch number below this line */ | |
139 | + /**/ | |
140 | + 5, | |
141 | /**/ | |
142 | ||
143 | -- | |
144 | Life would be so much easier if we could just look at the source code. | |
145 | ||
146 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
147 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
148 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
149 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |