| To: vim-dev@vim.org |
| Subject: patch 7.0.225 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.0.225 |
| Problem: When using setline() in an InsertEnter autocommand and doing "A" |
| the cursor ends up on the last byte in the line. (Yukihiro |
| Nakadaira) |
| Solution: Only adjust the column when using setline() for the cursor line. |
| Move it back to the head byte if necessary. |
| Files: src/eval.c, src/misc2.c |
| |
| |
| |
| |
| |
| *** 14397,14403 **** |
| if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK) |
| { |
| changed_bytes(lnum, 0); |
| ! check_cursor_col(); |
| rettv->vval.v_number = 0; /* OK */ |
| } |
| } |
| --- 14411,14418 ---- |
| if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK) |
| { |
| changed_bytes(lnum, 0); |
| ! if (lnum == curwin->w_cursor.lnum) |
| ! check_cursor_col(); |
| rettv->vval.v_number = 0; /* OK */ |
| } |
| } |
| |
| |
| |
| *** 516,522 **** |
| --- 516,529 ---- |
| || virtual_active()) |
| curwin->w_cursor.col = len; |
| else |
| + { |
| curwin->w_cursor.col = len - 1; |
| + #ifdef FEAT_MBYTE |
| + /* prevent cursor from moving on the trail byte */ |
| + if (has_mbyte) |
| + mb_adjust_cursor(); |
| + #endif |
| + } |
| } |
| |
| #ifdef FEAT_VIRTUALEDIT |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 225, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 14. You start introducing yourself as "Jim at I-I-Net dot net dot au" |
| |
| /// 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 /// |