diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-08-23 21:02:42 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-08-23 21:02:42 +0000 |
commit | 6f16eb817ba8b32c012e910e83bad98f1fe17f05 (patch) | |
tree | 9e21f9e8f0426644aa7abf3a8d622ade73c0a881 /src | |
parent | 7862282f2edc76533c5c0dcf49b57bf747a30ebc (diff) | |
download | vim-git-6f16eb817ba8b32c012e910e83bad98f1fe17f05.tar.gz |
updated for version 7.0135
Diffstat (limited to 'src')
-rw-r--r-- | src/globals.h | 1 | ||||
-rw-r--r-- | src/ops.c | 38 | ||||
-rw-r--r-- | src/version.h | 4 |
3 files changed, 27 insertions, 16 deletions
diff --git a/src/globals.h b/src/globals.h index 6bfc13dc7..29a643bc8 100644 --- a/src/globals.h +++ b/src/globals.h @@ -688,6 +688,7 @@ EXTERN int enc_dbcs INIT(= 0); /* One of DBCS_xxx values if DBCS encoding */ EXTERN int enc_unicode INIT(= 0); /* 2: UCS-2 or UTF-16, 4: UCS-4 */ EXTERN int enc_utf8 INIT(= FALSE); /* UTF-8 encoded Unicode */ +EXTERN int enc_latin1like INIT(= TRUE); /* 'encoding' is latin1 comp. */ # ifdef WIN3264 /* Codepage nr of 'encoding'. Negative means it's not been set yet, zero * means 'encoding' is not a valid codepage. */ @@ -2140,12 +2140,9 @@ op_tilde(oap) pos_T pos; #ifdef FEAT_VISUAL struct block_def bd; - int done; #endif + int todo; int did_change = 0; -#ifdef FEAT_MBYTE - colnr_T col; -#endif if (u_save((linenr_T)(oap->start.lnum - 1), (linenr_T)(oap->end.lnum + 1)) == FAIL) @@ -2159,19 +2156,15 @@ op_tilde(oap) { block_prep(oap, &bd, pos.lnum, FALSE); pos.col = bd.textcol; - for (done = 0; done < bd.textlen; ++done) + for (todo = bd.textlen; todo > 0; --todo) { +#ifdef FEAT_MBYTE + if (has_mbyte) + todo -= (*mb_ptr2len)(ml_get_pos(&pos)) - 1; +#endif did_change |= swapchar(oap->op_type, &pos); -# ifdef FEAT_MBYTE - col = pos.col + 1; -# endif if (inc(&pos) == -1) /* at end of file */ break; -# ifdef FEAT_MBYTE - if (pos.col > col) - /* Count extra bytes of a multi-byte character. */ - done += pos.col - col; -# endif } # ifdef FEAT_NETBEANS_INTG if (usingNetbeans && did_change) @@ -2202,8 +2195,12 @@ op_tilde(oap) else if (!oap->inclusive) dec(&(oap->end)); - while (ltoreq(pos, oap->end)) + for (todo = oap->end.col - pos.col + 1; todo > 0; --todo) { +#ifdef FEAT_MBYTE + if (has_mbyte) + todo -= (*mb_ptr2len)(ml_get_pos(&pos)) - 1; +#endif did_change |= swapchar(oap->op_type, &pos); if (inc(&pos) == -1) /* at end of file */ break; @@ -2282,6 +2279,19 @@ swapchar(op_type, pos) return FALSE; #ifdef FEAT_MBYTE + if (op_type == OP_UPPER && enc_latin1like && c == 0xdf) + { + pos_T sp = curwin->w_cursor; + + /* Special handling of German sharp s: change to "SS". */ + curwin->w_cursor = *pos; + del_char(FALSE); + ins_char('S'); + ins_char('S'); + curwin->w_cursor = sp; + inc(pos); + } + if (enc_dbcs != 0 && c >= 0x100) /* No lower/uppercase letter */ return FALSE; #endif diff --git a/src/version.h b/src/version.h index 7e4ca1483..8c6465e21 100644 --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 23)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 23, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 24)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 24, compiled " |