]>
Commit | Line | Data |
---|---|---|
9b1d76b7 AG |
1 | To: vim-dev@vim.org |
2 | Subject: patch 7.0.199 | |
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.0.199 | |
11 | Problem: When using multi-byte characters the combination of completion and | |
12 | formatting may result in a wrong cursor position. | |
13 | Solution: Don't decrement the cursor column, use dec_cursor(). (Yukihiro | |
14 | Nakadaira) Also check for the column to be zero. | |
15 | Files: src/edit.c | |
16 | ||
17 | ||
18 | *** ../vim-7.0.198/src/edit.c Sun Feb 4 02:37:40 2007 | |
19 | --- src/edit.c Fri Feb 16 01:15:49 2007 | |
20 | *************** | |
21 | *** 3448,3458 **** | |
22 | } | |
23 | else | |
24 | { | |
25 | /* put the cursor on the last char, for 'tw' formatting */ | |
26 | ! curwin->w_cursor.col--; | |
27 | if (stop_arrow() == OK) | |
28 | insertchar(NUL, 0, -1); | |
29 | ! curwin->w_cursor.col++; | |
30 | } | |
31 | ||
32 | auto_format(FALSE, TRUE); | |
33 | --- 3449,3464 ---- | |
34 | } | |
35 | else | |
36 | { | |
37 | + int prev_col = curwin->w_cursor.col; | |
38 | + | |
39 | /* put the cursor on the last char, for 'tw' formatting */ | |
40 | ! if (prev_col > 0) | |
41 | ! dec_cursor(); | |
42 | if (stop_arrow() == OK) | |
43 | insertchar(NUL, 0, -1); | |
44 | ! if (prev_col > 0 | |
45 | ! && ml_get_curline()[curwin->w_cursor.col] != NUL) | |
46 | ! inc_cursor(); | |
47 | } | |
48 | ||
49 | auto_format(FALSE, TRUE); | |
50 | *** ../vim-7.0.198/src/version.c Tue Feb 20 03:18:20 2007 | |
51 | --- src/version.c Tue Feb 20 03:32:12 2007 | |
52 | *************** | |
53 | *** 668,669 **** | |
54 | --- 668,671 ---- | |
55 | { /* Add new patch number below this line */ | |
56 | + /**/ | |
57 | + 199, | |
58 | /**/ | |
59 | ||
60 | -- | |
61 | hundred-and-one symptoms of being an internet addict: | |
62 | 156. You forget your friend's name but not her e-mail address. | |
63 | ||
64 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
65 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
66 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
67 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |