Mercurial > vim
comparison src/ex_getln.c @ 1612:3c251a30c8cc v7.1.325
updated for version 7.1-325
author | vimboss |
---|---|
date | Fri, 20 Jun 2008 16:31:07 +0000 |
parents | 9dd62cb57ed5 |
children | 82b5078be2dd |
comparison
equal
deleted
inserted
replaced
1611:c669f3280f59 | 1612:3c251a30c8cc |
---|---|
2051 #ifdef FEAT_MBYTE | 2051 #ifdef FEAT_MBYTE |
2052 /* Count ">" for double-wide multi-byte char that doesn't fit. */ | 2052 /* Count ">" for double-wide multi-byte char that doesn't fit. */ |
2053 if (has_mbyte) | 2053 if (has_mbyte) |
2054 correct_cmdspos(i, c); | 2054 correct_cmdspos(i, c); |
2055 #endif | 2055 #endif |
2056 /* If the cmdline doesn't fit, put cursor on last visible char. */ | 2056 /* If the cmdline doesn't fit, show cursor on last visible char. |
2057 * Don't move the cursor itself, so we can still append. */ | |
2057 if ((ccline.cmdspos += c) >= m) | 2058 if ((ccline.cmdspos += c) >= m) |
2058 { | 2059 { |
2059 ccline.cmdpos = i - 1; | |
2060 ccline.cmdspos -= c; | 2060 ccline.cmdspos -= c; |
2061 break; | 2061 break; |
2062 } | 2062 } |
2063 #ifdef FEAT_MBYTE | 2063 #ifdef FEAT_MBYTE |
2064 if (has_mbyte) | 2064 if (has_mbyte) |
2827 #ifdef FEAT_MBYTE | 2827 #ifdef FEAT_MBYTE |
2828 /* count ">" for a double-wide char that doesn't fit. */ | 2828 /* count ">" for a double-wide char that doesn't fit. */ |
2829 if (has_mbyte) | 2829 if (has_mbyte) |
2830 correct_cmdspos(ccline.cmdpos, c); | 2830 correct_cmdspos(ccline.cmdpos, c); |
2831 #endif | 2831 #endif |
2832 /* Stop cursor at the end of the screen */ | 2832 /* Stop cursor at the end of the screen, but do increment the |
2833 if (ccline.cmdspos + c >= m) | 2833 * insert position, so that entering a very long command |
2834 break; | 2834 * works, even though you can't see it. */ |
2835 ccline.cmdspos += c; | 2835 if (ccline.cmdspos + c < m) |
2836 ccline.cmdspos += c; | |
2836 #ifdef FEAT_MBYTE | 2837 #ifdef FEAT_MBYTE |
2837 if (has_mbyte) | 2838 if (has_mbyte) |
2838 { | 2839 { |
2839 c = (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos) - 1; | 2840 c = (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos) - 1; |
2840 if (c > len - i - 1) | 2841 if (c > len - i - 1) |
3330 } | 3331 } |
3331 | 3332 |
3332 /* | 3333 /* |
3333 * Do wildcard expansion on the string 'str'. | 3334 * Do wildcard expansion on the string 'str'. |
3334 * Chars that should not be expanded must be preceded with a backslash. | 3335 * Chars that should not be expanded must be preceded with a backslash. |
3335 * Return a pointer to alloced memory containing the new string. | 3336 * Return a pointer to allocated memory containing the new string. |
3336 * Return NULL for failure. | 3337 * Return NULL for failure. |
3337 * | 3338 * |
3338 * "orig" is the originally expanded string, copied to allocated memory. It | 3339 * "orig" is the originally expanded string, copied to allocated memory. It |
3339 * should either be kept in orig_save or freed. When "mode" is WILD_NEXT or | 3340 * should either be kept in orig_save or freed. When "mode" is WILD_NEXT or |
3340 * WILD_PREV "orig" should be NULL. | 3341 * WILD_PREV "orig" should be NULL. |
6109 ccline = save_ccline; | 6110 ccline = save_ccline; |
6110 cmdwin_type = 0; | 6111 cmdwin_type = 0; |
6111 | 6112 |
6112 exmode_active = save_exmode; | 6113 exmode_active = save_exmode; |
6113 | 6114 |
6114 /* Safety check: The old window or buffer was deleted: It's a a bug when | 6115 /* Safety check: The old window or buffer was deleted: It's a bug when |
6115 * this happens! */ | 6116 * this happens! */ |
6116 if (!win_valid(old_curwin) || !buf_valid(old_curbuf)) | 6117 if (!win_valid(old_curwin) || !buf_valid(old_curbuf)) |
6117 { | 6118 { |
6118 cmdwin_result = Ctrl_C; | 6119 cmdwin_result = Ctrl_C; |
6119 EMSG(_("E199: Active window or buffer deleted")); | 6120 EMSG(_("E199: Active window or buffer deleted")); |