]> granicus.if.org Git - vim/commitdiff
patch 8.1.0811: too many #ifdefs v8.1.0811
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Jan 2019 16:59:39 +0000 (17:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Jan 2019 16:59:39 +0000 (17:59 +0100)
Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, the final chapter.

54 files changed:
src/appveyor.bat
src/auto/configure
src/config.h.in
src/configure.ac
src/crypt_zip.c
src/feature.h
src/fileio.c
src/message.c
src/os_macosx.m
src/spell.h
src/structs.h
src/testdir/runtest.vim
src/testdir/test_alot_utf8.vim
src/testdir/test_arabic.vim
src/testdir/test_charsearch_utf8.vim
src/testdir/test_cmdline.vim
src/testdir/test_digraph.vim
src/testdir/test_display.vim
src/testdir/test_edit.vim
src/testdir/test_erasebackword.vim
src/testdir/test_expr_utf8.vim
src/testdir/test_functions.vim
src/testdir/test_ga.vim
src/testdir/test_iminsert.vim
src/testdir/test_increment_dbcs.vim
src/testdir/test_json.vim
src/testdir/test_makeencoding.vim
src/testdir/test_maparg.vim
src/testdir/test_mapping.vim
src/testdir/test_marks.vim
src/testdir/test_match.vim
src/testdir/test_matchadd_conceal_utf8.vim
src/testdir/test_mksession_utf8.vim
src/testdir/test_normal.vim
src/testdir/test_plus_arg_edit.vim
src/testdir/test_profile.vim
src/testdir/test_put.vim
src/testdir/test_regex_char_classes.vim
src/testdir/test_regexp_utf8.vim
src/testdir/test_search.vim
src/testdir/test_source_utf8.vim
src/testdir/test_spell.vim
src/testdir/test_startup_utf8.vim
src/testdir/test_termencoding.vim
src/testdir/test_terminal.vim
src/testdir/test_utf8.vim
src/testdir/test_utf8_comparisons.vim
src/testdir/test_viminfo.vim
src/testdir/test_virtualedit.vim
src/testdir/test_visual.vim
src/testdir/test_wordcount.vim
src/testdir/test_writefile.vim
src/version.c
src/vim.h

index 761f9b89083dffc7f7d35c9af3da54b71d621f14..f64a05ef2a21892940a5eccbcc04db55622f57a8 100644 (file)
@@ -7,7 +7,7 @@ cd %APPVEYOR_BUILD_FOLDER%
 cd src
 echo "Building MinGW 32bit console version"
 set PATH=c:\msys64\mingw32\bin;%PATH%
-mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
+mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
 :: Save vim.exe before Make clean, moved back below.
 copy vim.exe testdir
 mingw32-make.exe -f Make_ming.mak clean
@@ -16,24 +16,24 @@ mingw32-make.exe -f Make_ming.mak clean
 :: with specified features without python.
 echo "Building MinGW 32bit GUI version"
 if "%FEATURE%" == "HUGE" (
-    mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1
+    mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1
 ) ELSE (
-    mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
+    mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
 )
 .\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt
 
 echo "Building MSVC 64bit console Version"
 sed -e "s/\$(LINKARGS2)/\$(LINKARGS2) | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
-nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
+nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
 nmake -f Make_mvc2.mak clean
 
 :: build MSVC huge version with python and channel support
 :: GUI needs to be last, so that testing works
 echo "Building MSVC 64bit GUI Version"
 if "%FEATURE%" == "HUGE" (
-    nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1
+    nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1
 ) ELSE (
-    nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
+    nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
 )
 .\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt
 
index 0431addf0f1c66382289e857d8bc885109529e7f..a3302d2857a020def8ac2ec43fd3925d6ee891d7 100755 (executable)
@@ -7937,10 +7937,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_multibyte" >&5
 $as_echo "$enable_multibyte" >&6; }
-if test "$enable_multibyte" = "yes"; then
-  $as_echo "#define FEAT_MBYTE 1" >>confdefs.h
-
-else
+if test "$enable_multibyte" != "yes"; then
   as_fn_error $? "The multi-byte feature can no longer be disabled. If you have
                a problem with this, discuss on the Vim mailing list." "$LINENO" 5
 fi
index 9a7ba51efc21e5400a05efa0fa3d6bdac06ef34d..e13cc635f646557b5dc20b1e5f1a7029903ef889 100644 (file)
 /* Define if you want to include the Cscope interface. */
 #undef FEAT_CSCOPE
 
-/* Define if you want to include multibyte support. */
-#undef FEAT_MBYTE
-
 /* Define if you don't want to include right-left support. */
 #undef DISABLE_RIGHTLEFT
 
index 2dcfe46cb3f8203ac5216f3df1386f68e897afdb..e5525eaa632cddeb57feab2047b43112d368b8fd 100644 (file)
@@ -2124,9 +2124,7 @@ AC_ARG_ENABLE(multibyte,
        [  --enable-multibyte      Include multibyte editing support.], ,
        [enable_multibyte="yes"])
 AC_MSG_RESULT($enable_multibyte)
-if test "$enable_multibyte" = "yes"; then
-  AC_DEFINE(FEAT_MBYTE)
-else
+if test "$enable_multibyte" != "yes"; then
   AC_MSG_ERROR([The multi-byte feature can no longer be disabled. If you have
                a problem with this, discuss on the Vim mailing list.])
 fi
index e50fa6b1c50819ac87d5c287e5f213b9e22aa32e..ed17d956b0856c3f861a25f10759fde61eb4b3a0 100644 (file)
  */
 
 /* Need a type that should be 32 bits. 64 also works but wastes space. */
-# if VIM_SIZEOF_INT >= 4
 typedef unsigned int u32_T;    /* int is at least 32 bits */
-# else
-typedef unsigned long u32_T;   /* long should be 32 bits or more */
-# endif
 
 /* The state of encryption, referenced by cryptstate_T. */
 typedef struct {
index 59fcf785e50ccb467788b910043f3fc0d81b1959..81b432db032454d439ad28a11b307069da45fc98 100644 (file)
  *
  * Disabled for EBCDIC as it requires multibyte.
  */
-#if defined(FEAT_BIG) && !defined(DISABLE_ARABIC) && VIM_SIZEOF_INT >= 4 && !defined(EBCDIC)
+#if defined(FEAT_BIG) && !defined(DISABLE_ARABIC) && !defined(EBCDIC)
 # define FEAT_ARABIC
 #endif
 #ifdef FEAT_ARABIC
  * +multi_byte         Generic multi-byte character handling.
  *                     Now always enabled.
  */
-#if !defined(FEAT_MBYTE)
-# define FEAT_MBYTE
-#endif
-#if VIM_SIZEOF_INT < 4 && !defined(PROTO)
-       Error: Vim only works with 32 bit int or larger
-#endif
 
 /* Define this if you want to use 16 bit Unicode only, reduces memory used for
  * the screen structures. */
 /* #define UNICODE16 */
 
 /*
- * +multi_byte_ime     Win32 IME input method.  Requires +multi_byte.
- *                     Only for far-east Windows, so IME can be used to input
- *                     chars.  Not tested much!
+ * +multi_byte_ime     Win32 IME input method.  Only for far-east Windows, so
+ *                     IME can be used to input chars.  Not tested much!
  */
 #if defined(FEAT_GUI_W32) && !defined(FEAT_MBYTE_IME)
 /* #define FEAT_MBYTE_IME */
index aa84e9bb48b8574e2a07047797edda1ba6db363a..4cb13f27a5e904733ab8fa67d47b8e703f8bf10b 100644 (file)
@@ -1178,10 +1178,9 @@ retry:
         */
        if (!skip_read)
        {
-#if VIM_SIZEOF_INT > 2
-# if defined(SSIZE_MAX) && (SSIZE_MAX < 0x10000L)
+#if defined(SSIZE_MAX) && (SSIZE_MAX < 0x10000L)
                size = SSIZE_MAX;                   /* use max I/O size, 52K */
-# else
+#else
                /* Use buffer >= 64K.  Add linerest to double the size if the
                 * line gets very long, to avoid a lot of copying. But don't
                 * read more than 1 Mbyte at a time, so we can be interrupted.
@@ -1189,20 +1188,11 @@ retry:
                size = 0x10000L + linerest;
                if (size > 0x100000L)
                    size = 0x100000L;
-# endif
-#else
-               size = 0x7ff0L - linerest;          /* limit buffer to 32K */
 #endif
        }
 
        /* Protect against the argument of lalloc() going negative. */
-       if (
-#if VIM_SIZEOF_INT <= 2
-           linerest >= 0x7ff0
-#else
-           size < 0 || size + linerest + 1 < 0 || linerest >= MAXCOL
-#endif
-          )
+       if (size < 0 || size + linerest + 1 < 0 || linerest >= MAXCOL)
        {
            ++split;
            *ptr = NL;              /* split line by inserting a NL */
index c5d48f229c0b61f73b58fb41170e2fc56ee430d5..063fadae4a2ad17f624e0e29f87462ddcaf70b06 100644 (file)
@@ -4492,14 +4492,10 @@ vim_vsnprintf_typval(
                    {
                        /* Don't put the #if inside memchr(), it can be a
                         * macro. */
-# if VIM_SIZEOF_INT <= 2
-                       char *q = memchr(str_arg, '\0', precision);
-# else
                        /* memchr on HP does not like n > 2^31  !!! */
                        char *q = memchr(str_arg, '\0',
                                  precision <= (size_t)0x7fffffffL ? precision
                                                       : (size_t)0x7fffffffL);
-# endif
                        str_arg_l = (q == NULL) ? precision
                                                      : (size_t)(q - str_arg);
                    }
index 50ca361fbb9bc91f345512007b08a3962f1ee598..3b5c35adb952cf840052a2a6e79901cb85536cab 100644 (file)
@@ -130,18 +130,14 @@ clip_mch_request_selection(VimClipboard *cbd)
     char_u *str = (char_u*)[string UTF8String];
     int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
 
-#ifdef FEAT_MBYTE
     if (input_conv.vc_type != CONV_NONE)
        str = string_convert(&input_conv, str, &len);
-#endif
 
     if (str)
        clip_yank_selection(motion_type, str, len, cbd);
 
-#ifdef FEAT_MBYTE
     if (input_conv.vc_type != CONV_NONE)
        vim_free(str);
-#endif
 
 releasepool:
     [pool release];
@@ -169,7 +165,6 @@ clip_mch_set_selection(VimClipboard *cbd)
 
     /* TODO: Avoid overflow. */
     int len = (int)llen;
-#ifdef FEAT_MBYTE
     if (output_conv.vc_type != CONV_NONE)
     {
        char_u *conv_str = string_convert(&output_conv, str, &len);
@@ -179,7 +174,6 @@ clip_mch_set_selection(VimClipboard *cbd)
            str = conv_str;
        }
     }
-#endif
 
     if (len > 0)
     {
index 18c96446c2f32c4a81524914baff80120d4bd177..085f18c21626bb32e4990816cdad827ce5ab88cd 100644 (file)
 
 /* Type used for indexes in the word tree need to be at least 4 bytes.  If int
  * is 8 bytes we could use something smaller, but what? */
-#if VIM_SIZEOF_INT > 3
 typedef int idx_T;
-#else
-typedef long idx_T;
-#endif
 
 typedef int salfirst_T;
 
index 3216c580cc85fc9d9d2084786459a30c2de32fe8..e25ae173866a8fc09e0d8106c935438dc3aa3683 100644 (file)
@@ -416,12 +416,8 @@ struct u_header
 /*
  * structures used in undo.c
  */
-#if VIM_SIZEOF_INT > 2
-# define ALIGN_LONG    /* longword alignment and use filler byte */
-# define ALIGN_SIZE (sizeof(long))
-#else
-# define ALIGN_SIZE (sizeof(short))
-#endif
+#define ALIGN_LONG     /* longword alignment and use filler byte */
+#define ALIGN_SIZE (sizeof(long))
 
 #define ALIGN_MASK (ALIGN_SIZE - 1)
 
@@ -1229,19 +1225,11 @@ typedef unsigned long       uvarnumber_T;
 # endif
 #else
 /* Use 32-bit Number. */
-# if VIM_SIZEOF_INT <= 3       /* use long if int is smaller than 32 bits */
-typedef long               varnumber_T;
-typedef unsigned long      uvarnumber_T;
-#define VARNUM_MIN         LONG_MIN
-#define VARNUM_MAX         LONG_MAX
-#define UVARNUM_MAX        ULONG_MAX
-# else
 typedef int                varnumber_T;
 typedef unsigned int       uvarnumber_T;
 #define VARNUM_MIN         INT_MIN
 #define VARNUM_MAX         INT_MAX
 #define UVARNUM_MAX        UINT_MAX
-# endif
 #endif
 
 typedef double float_T;
index a8b43aaed97666292a7dccaabd69e505bfb61420..3f49ccb1cb51d08fb611a87e633dbc126360c50d 100644 (file)
@@ -49,13 +49,9 @@ source setup.vim
 " This also enables use of line continuation.
 set nocp viminfo+=nviminfo
 
-" Use utf-8 or latin1 by default, instead of whatever the system default
-" happens to be.  Individual tests can overrule this at the top of the file.
-if has('multi_byte')
-  set encoding=utf-8
-else
-  set encoding=latin1
-endif
+" Use utf-8 by default, instead of whatever the system default happens to be.
+" Individual tests can overrule this at the top of the file.
+set encoding=utf-8
 
 " REDIR_TEST_TO_NULL has a very permissive SwapExists autocommand which is for
 " the test_name.vim file itself. Replace it here with a more restrictive one,
index 648d806a94573f0433e55fa84af950eb42854871..be0bd014132a3dd3c3ef63a9a8a1560c81694114 100644 (file)
@@ -2,8 +2,7 @@
 " This makes testing go faster, since Vim doesn't need to restart.
 
 " These tests use utf8 'encoding'.  Setting 'encoding' is already done in
-" runtest.vim.  Checking for the multi_byte feature is in the individual
-" files, so that they can be run by themselves.
+" runtest.vim.
 
 source test_charsearch_utf8.vim
 source test_expr_utf8.vim
index 17e925ee7fa3a51b7944a5b4f9a9da670f6c9f59..bc31db7e7c81b54b6813a950dbc1979417a8dbc1 100644 (file)
@@ -2,7 +2,7 @@
 " NOTE: This just checks if the code works. If you know Arabic please add
 " functional tests that check the shaping works with real text.
 
-if !has('arabic') || !has('multi_byte')
+if !has('arabic')
   finish
 endif
 
index 399ac51c4854d1e9bbcfd17487716f31b46d43e5..82a807ac5be7913feeb39556d8f32a2ef10b386d 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for related f{char} and t{char} using utf-8.
-if !has('multi_byte')
-  finish
-endif
 
 " Test for t,f,F,T movement commands
 func Test_search_cmds()
index 9a4ccd11d594faeaa1c46c4f2be5917069b5c2ed..4dcda858e885c01d735812ac2de5ef8c43722487 100644 (file)
@@ -582,7 +582,7 @@ func Test_setcmdpos()
 endfunc
 
 func Test_cmdline_overstrike()
-  let encodings = has('multi_byte') ? [ 'latin1', 'utf8' ] : [ 'latin1' ]
+  let encodings = ['latin1', 'utf8']
   let encoding_save = &encoding
 
   for e in encodings
@@ -601,11 +601,9 @@ func Test_cmdline_overstrike()
     call assert_equal('"ab0cd3ef4', @:)
   endfor
 
-  if has('multi_byte')
-    " Test overstrike with multi-byte characters.
-    call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt')
-    call assert_equal('"テabキcdエディタ', @:)
-  endif
+  " Test overstrike with multi-byte characters.
+  call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt')
+  call assert_equal('"テabキcdエディタ', @:)
 
   let &encoding = encoding_save
 endfunc
index d5b0a7b72e8b324c066a066a751cfb1fa645d242..8d56a1a247ed3af9ce665aecde2ec2966fffb42a 100644 (file)
@@ -1,6 +1,6 @@
 " Tests for digraphs
 
-if !has("digraphs") || !has("multi_byte")
+if !has("digraphs")
   finish
 endif
 
@@ -466,9 +466,6 @@ func Test_show_digraph()
 endfunc
 
 func Test_show_digraph_cp1251()
-  if !has('multi_byte')
-    return
-  endif
   new
   set encoding=cp1251
   call Put_Dig("='")
index e0e3e3b54cca197572c503021dfc334a7ce06abb..81ffb2c944f5290f920a8f5fbc04580fb5f21d1b 100644 (file)
@@ -39,7 +39,7 @@ func Test_display_foldcolumn()
 endfunc
 
 func Test_display_foldtext_mbyte()
-  if !has("folding") || !has("multi_byte")
+  if !has("folding")
     return
   endif
   call NewWindow(10, 40)
index 7b31469632b9484b16caf4ae5cad53d29b1847b5..9a60d018e11ec83c1a7f21c68dbcb92120c8a6ee 100644 (file)
@@ -37,12 +37,10 @@ func Test_edit_01()
   call assert_equal([''], getline(1,'$'))
   %d
   " 4) delete a multibyte character
-  if has("multi_byte")
-    call setline(1, "\u0401")
-    call feedkeys("i\<del>\<esc>", 'tnix')
-    call assert_equal([''], getline(1,'$'))
-    %d
-  endif
+  call setline(1, "\u0401")
+  call feedkeys("i\<del>\<esc>", 'tnix')
+  call assert_equal([''], getline(1,'$'))
+  %d
   " 5.1) delete linebreak with 'bs' option containing eol
   let _bs=&bs
   set bs=eol
@@ -440,7 +438,7 @@ endfunc
 
 func Test_edit_CTRL_()
   " disabled for Windows builds, why?
-  if !has("multi_byte") || !has("rightleft") || has("win32")
+  if !has("rightleft") || has("win32")
     return
   endif
   let _encoding=&encoding
@@ -608,15 +606,14 @@ func Test_edit_CTRL_K()
   endtry
   call delete('Xdictionary.txt')
 
-  if has("multi_byte")
-    call test_override("char_avail", 1)
-    set showcmd
-    %d
-    call feedkeys("A\<c-k>a:\<esc>", 'tnix')
-    call assert_equal(['ä'], getline(1, '$'))
-    call test_override("char_avail", 0)
-    set noshowcmd
-  endif
+  call test_override("char_avail", 1)
+  set showcmd
+  %d
+  call feedkeys("A\<c-k>a:\<esc>", 'tnix')
+  call assert_equal(['ä'], getline(1, '$'))
+  call test_override("char_avail", 0)
+  set noshowcmd
+
   bw!
 endfunc
 
index 098d6edfcb0c501990b2e00cd756fb3eaa7cdb96..9522ec2cd65df419e80823e570d0fc9829ef17e3 100644 (file)
@@ -1,10 +1,5 @@
 
 func Test_erasebackword()
-  if !has('multi_byte')
-    return
-  endif
-
-  set encoding=utf-8
   enew
 
   exe "normal o wwwこんにちわ世界ワールドvim \<C-W>"
@@ -21,5 +16,4 @@ func Test_erasebackword()
   call assert_equal('', getline('.'))
 
   enew!
-  set encoding&
 endfunc
index 1737a9f745f6cd09503b0db398676b7b3a72d9df..fad725d2e5db277a6355a7ffdc10e9aa759b76d4 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for expressions using utf-8.
-if !has('multi_byte')
-  finish
-endif
 
 func Test_strgetchar()
   call assert_equal(char2nr('á'), strgetchar('áxb', 0))
index d942d07687e924cf269cc4c9a38aaa7aa1f01116..3d8104817dae527446969ac4f95b3b98339b4d24 100644 (file)
@@ -106,11 +106,9 @@ func Test_strwidth()
     call assert_equal(4, strwidth(1234))
     call assert_equal(5, strwidth(-1234))
 
-    if has('multi_byte')
-      call assert_equal(2, strwidth('😉'))
-      call assert_equal(17, strwidth('Eĥoŝanĝo ĉiuĵaŭde'))
-      call assert_equal((aw == 'single') ? 6 : 7, strwidth('Straße'))
-    endif
+    call assert_equal(2, strwidth('😉'))
+    call assert_equal(17, strwidth('Eĥoŝanĝo ĉiuĵaŭde'))
+    call assert_equal((aw == 'single') ? 6 : 7, strwidth('Straße'))
 
     call assert_fails('call strwidth({->0})', 'E729:')
     call assert_fails('call strwidth([])', 'E730:')
@@ -277,10 +275,8 @@ func Test_strpart()
   call assert_equal('fg', strpart('abcdefg', 5, 4))
   call assert_equal('defg', strpart('abcdefg', 3))
 
-  if has('multi_byte')
-    call assert_equal('lép', strpart('éléphant', 2, 4))
-    call assert_equal('léphant', strpart('éléphant', 2))
-  endif
+  call assert_equal('lép', strpart('éléphant', 2, 4))
+  call assert_equal('léphant', strpart('éléphant', 2))
 endfunc
 
 func Test_tolower()
@@ -290,10 +286,6 @@ func Test_tolower()
   call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~',
           \ tolower(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'))
 
-  if !has('multi_byte')
-    return
-  endif
-
   " Test with a few uppercase diacritics.
   call assert_equal("aàáâãäåāăąǎǟǡả", tolower("AÀÁÂÃÄÅĀĂĄǍǞǠẢ"))
   call assert_equal("bḃḇ", tolower("BḂḆ"))
@@ -368,10 +360,6 @@ func Test_toupper()
   call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~',
           \ toupper(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'))
 
-  if !has('multi_byte')
-    return
-  endif
-
   " Test with a few lowercase diacritics.
   call assert_equal("AÀÁÂÃÄÅĀĂĄǍǞǠẢ", toupper("aàáâãäåāăąǎǟǡả"))
   call assert_equal("BḂḆ", toupper("bḃḇ"))
index 6a7cba28f097d0b00333ecbd06a00666d06fbf46..ea3d211aebfbee053d18d1089b6a9514e2f0a51f 100644 (file)
@@ -21,10 +21,6 @@ func Test_ga_command()
 
   call assert_equal("\n<e>  101,  Hex 65,  Octal 145",   Do_ga('e'))
 
-  if !has('multi_byte')
-    return
-  endif
-
   " Test a few multi-bytes characters.
   call assert_equal("\n<é> 233, Hex 00e9, Oct 351, Digr e'",    Do_ga('é'))
   call assert_equal("\n<ẻ> 7867, Hex 1ebb, Oct 17273, Digr e2", Do_ga('ẻ'))
index 142aec0bac6025c8e18242f6732d4c66a46af4db..1a8e4c8a14eb0205500059f49c4dc5e035cb51df 100644 (file)
@@ -1,7 +1,3 @@
-if !has('multi_byte')
-  finish
-endif
-
 source view_util.vim
 
 let s:imactivatefunc_called = 0
index dea405c63373bbe889d4a0c35ad3b5dc6f469e62..80b81acc7988db2908c338e66375cabcc8cd6197 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for using Ctrl-A/Ctrl-X using DBCS.
-if !has('multi_byte')
-  finish
-endif
 set encoding=cp932
 scriptencoding cp932
 
index e0a550c844fc60c21c6a85700ff5dbdbe55dba43..fb3d9927e4262e3de1c6d98f1b1c49dfd9859b3a 100644 (file)
@@ -1,10 +1,5 @@
 " Test for JSON functions.
 
-" JSON requires using utf-8, because conversion breaks the asserts.
-if !has('multi_byte')
-  finish
-endif
-
 let s:json1 = '"str\"in\\g"'
 let s:var1 = "str\"in\\g"
 let s:json2 = '"\u0001\u0002\u0003\u0004\u0005\u0006\u0007"'
@@ -79,10 +74,8 @@ func Test_json_encode()
   call assert_equal(s:json4, json_encode(s:var4))
   call assert_equal(s:json5, json_encode(s:var5))
 
-  if has('multi_byte')
-    call assert_equal(s:jsonmb, json_encode(s:varmb))
-    " no test for surrogate pair, json_encode() doesn't create them.
-  endif
+  call assert_equal(s:jsonmb, json_encode(s:varmb))
+  " no test for surrogate pair, json_encode() doesn't create them.
 
   call assert_equal(s:jsonnr, json_encode(s:varnr))
   if has('float')
@@ -121,11 +114,9 @@ func Test_json_decode()
   call assert_equal(s:var4, json_decode(s:json4))
   call assert_equal(s:var5, json_decode(s:json5))
 
-  if has('multi_byte')
-    call assert_equal(s:varmb, json_decode(s:jsonmb))
-    call assert_equal(s:varsp1, json_decode(s:jsonsp1))
-    call assert_equal(s:varsp2, json_decode(s:jsonsp2))
-  endif
+  call assert_equal(s:varmb, json_decode(s:jsonmb))
+  call assert_equal(s:varsp1, json_decode(s:jsonsp1))
+  call assert_equal(s:varsp2, json_decode(s:jsonsp2))
 
   call assert_equal(s:varnr, json_decode(s:jsonnr))
   if has('float')
@@ -197,10 +188,8 @@ func Test_js_encode()
   call assert_equal(s:json4, js_encode(s:var4))
   call assert_equal(s:json5, js_encode(s:var5))
 
-  if has('multi_byte')
-    call assert_equal(s:jsonmb, js_encode(s:varmb))
-    " no test for surrogate pair, js_encode() doesn't create them.
-  endif
+  call assert_equal(s:jsonmb, js_encode(s:varmb))
+  " no test for surrogate pair, js_encode() doesn't create them.
 
   call assert_equal(s:jsonnr, js_encode(s:varnr))
   if has('float')
@@ -237,11 +226,9 @@ func Test_js_decode()
   call assert_equal(s:var4, js_decode(s:json4))
   call assert_equal(s:var5, js_decode(s:json5))
 
-  if has('multi_byte')
-    call assert_equal(s:varmb, js_decode(s:jsonmb))
-    call assert_equal(s:varsp1, js_decode(s:jsonsp1))
-    call assert_equal(s:varsp2, js_decode(s:jsonsp2))
-  endif
+  call assert_equal(s:varmb, js_decode(s:jsonmb))
+  call assert_equal(s:varsp1, js_decode(s:jsonsp1))
+  call assert_equal(s:varsp2, js_decode(s:jsonsp2))
 
   call assert_equal(s:varnr, js_decode(s:jsonnr))
   if has('float')
index a3d5538a47efbbf20802fbcda02a359b62ff908f..d18b3b6de8169361eea2930acf303cc3fc4dfe63 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for 'makeencoding'.
-if !has('multi_byte')
-  finish
-endif
 
 source shared.vim
 
index c9e440edc092a77eefe2855a20356dec9799aa4b..86e046b5d609c56ee68832fcafc9f90c19c5c299 100644 (file)
@@ -1,8 +1,5 @@
 " Tests for maparg().
 " Also test utf8 map with a 0x80 byte.
-if !has("multi_byte")
-  finish
-endif
 
 function s:SID()     
   return str2nr(matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$'))
index 4ac06a10c9a5cf38c0b9814b237ae5521c668146..5aaa743fadb896679eb07d8067fa5939066bc1cd 100644 (file)
@@ -1,9 +1,5 @@
 " Tests for mappings and abbreviations
 
-if !has('multi_byte')
-  finish
-endif
-
 func Test_abbreviation()
   " abbreviation with 0x80 should work
   inoreab чкпр   vim
index 70c4e83adb654117af29e83da9f5b093c507aed4..2fb95a53627a9305d4f4fb4b02a351b4612b661c 100644 (file)
@@ -122,9 +122,6 @@ func Test_marks_cmd()
 endfunc
 
 func Test_marks_cmd_multibyte()
-  if !has('multi_byte')
-    return
-  endif
   new Xone
   call setline(1, [repeat('á', &columns)])
   norm! ma
index 70f049099fbcfb76a76f1216cb1990fc7f60a600..94bca9ad38ad42c4c10c6a08515e150c23f36c58 100644 (file)
@@ -114,36 +114,33 @@ function Test_match()
   call assert_equal([{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}], getmatches())
   call clearmatches()
 
-  "
-  if has('multi_byte')
-    call setline(1, 'abcdΣabcdef')
-    call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
-    1
-    redraw!
-    let v1 = screenattr(1, 1)
-    let v4 = screenattr(1, 4)
-    let v5 = screenattr(1, 5)
-    let v6 = screenattr(1, 6)
-    let v7 = screenattr(1, 7)
-    let v8 = screenattr(1, 8)
-    let v9 = screenattr(1, 9)
-    let v10 = screenattr(1, 10)
-    call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches())
-    call assert_notequal(v1, v4)
-    call assert_equal(v5, v4)
-    call assert_equal(v6, v1)
-    call assert_equal(v7, v1)
-    call assert_equal(v8, v4)
-    call assert_equal(v9, v4)
-    call assert_equal(v10, v1)
-
-    " Check, that setmatches() can correctly restore the matches from matchaddpos()
-    call matchadd('MyGroup1', '\%2lmatchadd')
-    let m=getmatches()
-    call clearmatches()
-    call setmatches(m)
-    call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches())
-  endif
+  call setline(1, 'abcdΣabcdef')
+  call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
+  1
+  redraw!
+  let v1 = screenattr(1, 1)
+  let v4 = screenattr(1, 4)
+  let v5 = screenattr(1, 5)
+  let v6 = screenattr(1, 6)
+  let v7 = screenattr(1, 7)
+  let v8 = screenattr(1, 8)
+  let v9 = screenattr(1, 9)
+  let v10 = screenattr(1, 10)
+  call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches())
+  call assert_notequal(v1, v4)
+  call assert_equal(v5, v4)
+  call assert_equal(v6, v1)
+  call assert_equal(v7, v1)
+  call assert_equal(v8, v4)
+  call assert_equal(v9, v4)
+  call assert_equal(v10, v1)
+
+  " Check, that setmatches() can correctly restore the matches from matchaddpos()
+  call matchadd('MyGroup1', '\%2lmatchadd')
+  let m=getmatches()
+  call clearmatches()
+  call setmatches(m)
+  call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches())
 
   highlight MyGroup1 NONE
   highlight MyGroup2 NONE
index 68792fbcb53b8a2a215281e8d87ea53a125f2a7e..d280c153ac4b3781fa7d6a6bf9dd5f6f62e69ecc 100644 (file)
@@ -1,5 +1,5 @@
 " Test for matchadd() and conceal feature using utf-8.
-if !has('conceal') || !has('multi_byte')
+if !has('conceal')
   finish
 endif
 
index 8ffbba2a1c17206122d5db6d75c265cb8083e15f..67af3a9ca2b247cc874ba75333664184a2cb8d9b 100644 (file)
@@ -3,7 +3,7 @@
 set encoding=utf-8
 scriptencoding utf-8
 
-if !has('multi_byte') || !has('mksession')
+if !has('mksession')
   finish
 endif
 
index aac75da71b3bb37e6b8c02eb7f3258aebda63ef3..1224a3f7da2bf8e7555fa423242f81af9588ded1 100644 (file)
@@ -1368,10 +1368,6 @@ func Test_normal23_K()
 endfunc
 
 func Test_normal24_rot13()
-  " This test uses multi byte characters
-  if !has("multi_byte")
-    return
-  endif
   " Testing for g?? g?g?
   new
   call append(0, 'abcdefghijklmnopqrstuvwxyzäüö')
@@ -1621,10 +1617,6 @@ fun! Test_normal29_brace()
 endfunc
 
 fun! Test_normal30_changecase()
-  " This test uses multi byte characters
-  if !has("multi_byte")
-    return
-  endif
   new
   call append(0, 'This is a simple test: äüöß')
   norm! 1ggVu
@@ -1894,42 +1886,36 @@ func Test_g_ctrl_g()
   call assert_equal("\nCol 1 of 10; Line 1 of 2; Word 1 of 4; Char 1 of 23; Byte 1 of 22", a)
   set bin & eol&
 
-  if has('multi_byte')
-    call setline(1, ['Français', '日本語'])
+  call setline(1, ['Français', '日本語'])
 
-    let a = execute(":norm! \<Esc>gojlg\<c-g>")
-    call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20", a)
+  let a = execute(":norm! \<Esc>gojlg\<c-g>")
+  call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20", a)
 
-    let a = execute(":norm! \<Esc>gojvlg\<c-g>")
-    call assert_equal("\nSelected 1 of 2 Lines; 1 of 2 Words; 2 of 13 Chars; 6 of 20 Bytes", a)
+  let a = execute(":norm! \<Esc>gojvlg\<c-g>")
+  call assert_equal("\nSelected 1 of 2 Lines; 1 of 2 Words; 2 of 13 Chars; 6 of 20 Bytes", a)
 
-    let a = execute(":norm! \<Esc>goll\<c-v>jlg\<c-g>")
-    call assert_equal("\nSelected 4 Cols; 2 of 2 Lines; 2 of 2 Words; 6 of 13 Chars; 11 of 20 Bytes", a)
+  let a = execute(":norm! \<Esc>goll\<c-v>jlg\<c-g>")
+  call assert_equal("\nSelected 4 Cols; 2 of 2 Lines; 2 of 2 Words; 6 of 13 Chars; 11 of 20 Bytes", a)
 
-    set fenc=utf8 bomb
-    let a = execute(":norm! \<Esc>gojlg\<c-g>")
-    call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+3 for BOM)", a)
+  set fenc=utf8 bomb
+  let a = execute(":norm! \<Esc>gojlg\<c-g>")
+  call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+3 for BOM)", a)
 
-    set fenc=utf16 bomb
-    let a = execute(":norm! g\<c-g>")
-    call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+2 for BOM)", a)
+  set fenc=utf16 bomb
+  let a = execute(":norm! g\<c-g>")
+  call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+2 for BOM)", a)
 
-    set fenc=utf32 bomb
-    let a = execute(":norm! g\<c-g>")
-    call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+4 for BOM)", a)
+  set fenc=utf32 bomb
+  let a = execute(":norm! g\<c-g>")
+  call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+4 for BOM)", a)
 
-    set fenc& bomb&
-  endif
+  set fenc& bomb&
 
   set ff&
   bwipe!
 endfunc
 
 fun! Test_normal34_g_cmd3()
-  if !has("multi_byte")
-    return
-  endif
-
   " Test for g8
   new
   let a=execute(':norm! 1G0g8')
@@ -1948,9 +1934,6 @@ fun! Test_normal34_g_cmd3()
 endfunc
 
 func Test_normal_8g8()
-  if !has("multi_byte")
-    return
-  endif
   new
 
   " Test 8g8 which finds invalid utf8 at or after the cursor.
@@ -2290,11 +2273,6 @@ func Test_normal45_drop()
 endfunc
 
 func Test_normal46_ignore()
-  " This test uses multi byte characters
-  if !has("multi_byte")
-    return
-  endif
-
   new
   " How to test this?
   " let's just for now test, that the buffer
@@ -2470,9 +2448,7 @@ func Test_normal54_Ctrl_bsl()
   call assert_equal(['abcdefghijklmn'], getline(1,'$'))
   exe "norm! df\<c-\>m"
   call assert_equal(['abcdefghijklmn'], getline(1,'$'))
-  if !has("multi_byte")
-    return
-  endif
+
   call setline(2, 'abcdefghijklmnāf')
   norm! 2gg0
   exe "norm! df\<Char-0x101>"
@@ -2494,9 +2470,6 @@ func Test_normal_large_count()
 endfunc
 
 func Test_delete_until_paragraph()
-  if !has('multi_byte')
-    return
-  endif
   new
   normal grádv}
   call assert_equal('á', getline(1))
index e91a6e467a1b6a2b63d4b5b58016e751c38dc86a..e31680e7b6e97d4e7e7be3d1d0f9339192ffbb28 100644 (file)
@@ -10,10 +10,6 @@ function Test_edit()
 endfunction
 
 func Test_edit_bad()
-  if !has('multi_byte')
-    finish
-  endif
-
   " Test loading a utf8 file with bad utf8 sequences.
   call writefile(["[\xff][\xc0][\xe2\x89\xf0][\xc2\xc2]"], "Xfile")
   new
index 1d4952317b813353cbff9705dca979f033d36ddd..d6e9c03bd59d4a3e2f88db724a03b10f15c3abce 100644 (file)
@@ -407,7 +407,7 @@ func Test_profile_errors()
 endfunc
 
 func Test_profile_truncate_mbyte()
-  if !has('multi_byte') || &enc !=# 'utf-8'
+  if &enc !=# 'utf-8'
     return
   endif
 
index 61b74297ffff1a1f1e5ecf7d8ff2e6a729214982..2a9e8a3c03194597566924e3277fb51550ae3c05 100644 (file)
@@ -1,9 +1,6 @@
 " Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
 
 func Test_put_block()
-  if !has('multi_byte')
-    return
-  endif
   new
   call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
   call feedkeys("\<C-V>y", 'x')
index 78735029430d49e84ded40e3f01372a3bff6f173..c1a4202c2bde784a00ab09a2d8c52ae28f94fe70 100644 (file)
@@ -1,9 +1,6 @@
 " Tests for regexp with backslash and other special characters inside []
 " Also test backslash for hex/octal numbered character.
 "
-if !has('multi_byte')
-  finish
-endif
 
 scriptencoding utf-8
 
index bec5e0ed4fadbfa59a7f7a11bf3bf5082216741a..f618870315f9bdb0f2f219512ee7ab6351c32b4b 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for regexp in utf8 encoding
-if !has('multi_byte')
-  finish
-endif
 
 func s:equivalence_test()
   let str = "AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ"
index 86df794b53413cad55b506614006f23a573bd148..0dfea49f65015e9a7881c723b4a5705ecfc6d8a4 100644 (file)
@@ -1127,9 +1127,6 @@ endfunc
 
 " Test for search('multi-byte char', 'bce')
 func Test_search_multibyte()
-  if !has('multi_byte')
-    return
-  endif
   let save_enc = &encoding
   set encoding=utf8
   enew!
@@ -1178,7 +1175,7 @@ func Test_search_Ctrl_L_combining()
     " ' ̇' U+0307 Dec:775 COMBINING DOT ABOVE &#x307; /\%u307\Z "\u0307"
     " ' ̣' U+0323 Dec:803 COMBINING DOT BELOW &#x323; /\%u323 "\u0323" 
   " Those should also appear on the commandline
-  if !has('multi_byte') || !exists('+incsearch')
+  if !exists('+incsearch')
     return
   endif
   call Cmdline3_prep()
index c29c2ec1f3691a7812fa691e66c5a02bfb559937..e93ea29dff7cf22bc8c183cdb5020f18246729eb 100644 (file)
@@ -1,7 +1,4 @@
 " Test the :source! command
-if !has('multi_byte')
-  finish
-endif
 
 func Test_source_utf8()
   " check that sourcing a script with 0x80 as second byte works
index 1230c206d955d20252e6cd6f77558c65f93363c1..76ad12e4c0e0bba5634b88f1d0840c970e558fec 100644 (file)
@@ -135,10 +135,8 @@ func Test_spellinfo()
   set enc=cp1250 spell spelllang=en
   call assert_match("^\nfile: .*/runtime/spell/en.ascii.spl\n$", execute('spellinfo'))
 
-  if has('multi_byte')
-    set enc=utf-8 spell spelllang=en
-    call assert_match("^\nfile: .*/runtime/spell/en.utf-8.spl\n$", execute('spellinfo'))
-  endif
+  set enc=utf-8 spell spelllang=en
+  call assert_match("^\nfile: .*/runtime/spell/en.utf-8.spl\n$", execute('spellinfo'))
 
   set enc=latin1 spell spelllang=en_us,en_nz
   call assert_match("^\n" .
index ef1a997ea45cc854366d8556bafa477e66872466..8b3eca10d762d9fc2f01d539d088ba92dc9dc947 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for startup using utf-8.
-if !has('multi_byte')
-  finish
-endif
 
 source shared.vim
 source screendump.vim
index 6192dcfd8b283d97c1ca678bf0fc724ef8139dc0..f4f5c5aaa9ed9e4fd24e642b312e96f3f839f443 100644 (file)
@@ -2,7 +2,7 @@
 " setting 'termencoding' to make it work.
 
 " This only works with "iconv".
-if !has('multi_byte') || !has('iconv')
+if !has('iconv')
   finish
 endif
 
index 821154a9f87e84b590271c8149429454adb5a5ad..25ec2b5ca5791d7a72dd3832fe31ea76b00d66da 100644 (file)
@@ -209,9 +209,6 @@ func Test_terminal_scrape_123()
 endfunc
 
 func Test_terminal_scrape_multibyte()
-  if !has('multi_byte')
-    return
-  endif
   call writefile(["léttまrs"], 'Xtext')
   if has('win32')
     " Run cmd with UTF-8 codepage to make the type command print the expected
index 699df62fe31983e6fc29c2345e6dc98429de75f7..8a71f5035164292f654617d44983c66ee1866db6 100644 (file)
@@ -1,7 +1,4 @@
 " Tests for Unicode manipulations
-if !has('multi_byte')
-  finish
-endif
  
 
 " Visual block Insert adjusts for multi-byte char
index a22cbb2f4e98a507e2fd16523383a5ad8410fef0..312925b3a65638feea5f9660cfeb4923f0020ebf 100644 (file)
@@ -1,10 +1,6 @@
 " Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c)
 " Also test "g~ap".
 
-if !has("multi_byte")
-  finish
-endif
-
 func Ch(a, op, b, expected)
   call assert_equal(eval(printf('"%s" %s "%s"', a:a, a:op, a:b)), a:expected,
         \ printf('"%s" %s "%s" should return %d', a:a, a:op, a:b, a:expected))
index 300f3a6556c327e7ee7e75d8576b8f5ac71eae47..cea78e574808171be4ffc5728a7afc122a274cc8 100644 (file)
@@ -391,9 +391,6 @@ func Test_viminfo_jumplist()
 endfunc
 
 func Test_viminfo_encoding()
-  if !has('multi_byte')
-    return
-  endif
   set enc=latin1
   call histdel(':')
   call histadd(':', "echo '\xe9'")
index abe79f6a4ad8b24be423546e4fd5cd33deaf2ee9..67adede8d794b2fa1549b170033ee09e080cfdb0 100644 (file)
@@ -48,11 +48,9 @@ func Test_replace_end_of_line()
   call setline(1, range(20))
   exe "normal! gg2jv10lr-"
   call assert_equal(["1", "-----------", "3"], getline(2,4))
-  if has('multi_byte')
-    call setline(1, range(20))
-    exe "normal! gg2jv10lr\<c-k>hh"
-    call assert_equal(["1", "───────────", "3"], getline(2,4))
-  endif
+  call setline(1, range(20))
+  exe "normal! gg2jv10lr\<c-k>hh"
+  call assert_equal(["1", "───────────", "3"], getline(2,4))
 
   bwipe!
   set virtualedit=
index 64431821171ee54df4b9b356bc0bdb9f72c9f58a..77064bab265ff0dbaef89a056763765b05a50eab 100644 (file)
@@ -6,9 +6,6 @@ endif
 
 func Test_block_shift_multibyte()
   " Uses double-wide character.
-  if !has('multi_byte')
-    return
-  endif
   split
   call setline(1, ['xヹxxx', 'ヹxxx'])
   exe "normal 1G0l\<C-V>jl>"
index 75c4e4bffab5323d44350f2b82852ccbe3567f5f..6a3d4109a8fd91f28cd111f9c47983565cfd163a 100644 (file)
@@ -1,9 +1,5 @@
 " Test for wordcount() function
 
-if !has('multi_byte')
-  finish
-endif
-
 func Test_wordcount()
   let save_enc = &enc
   set encoding=utf-8
index d1f63466c2702c62e6b30182d556beecf12a7604..2e47b48a8f64294fd65d09d1f9c7c039df2ff960 100644 (file)
@@ -33,7 +33,7 @@ func Test_writefile_fails_gently()
 endfunc
 
 func Test_writefile_fails_conversion()
-  if !has('multi_byte') || !has('iconv') || system('uname -s') =~ 'SunOS'
+  if !has('iconv') || system('uname -s') =~ 'SunOS'
     return
   endif
   set nobackup nowritebackup
index 7898c1a2fe87643f8c0b2e66be7a618e9013680e..c472ece2c709feb3aff8e382394df2bafd68d4c8 100644 (file)
@@ -787,6 +787,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    811,
 /**/
     810,
 /**/
index 37e9d5ba224be08349c8005b5ecd0b3f3f5b081c..3febc62ffa46c54365e6b6a896f40c24c321edbe 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
 #  define VIM_SIZEOF_INT __SIZEOF_INT__
 #endif
 
+#if VIM_SIZEOF_INT < 4 && !defined(PROTO)
+    Error: Vim only works with 32 bit int or larger
+#endif
+
 /*
  * #defines for optionals and features
  * Also defines FEAT_TINY, FEAT_SMALL, etc. when FEAT_HUGE is defined.
@@ -1664,8 +1668,6 @@ typedef long      linenr_T;               /* line number type */
 typedef int    colnr_T;                /* column number type */
 typedef unsigned short disptick_T;     /* display tick type */
 
-#define MAXLNUM (0x7fffffffL)          /* maximum (invalid) line number */
-
 /*
  * Well, you won't believe it, but some S/390 machines ("host", now also known
  * as zServer) use 31 bit pointers. There are also some newer machines, that
@@ -1675,14 +1677,12 @@ typedef unsigned short disptick_T;      /* display tick type */
  * With this we restrict the maximum line length to 1073741823. I guess this is
  * not a real problem. BTW:  Longer lines are split.
  */
-#if VIM_SIZEOF_INT >= 4
-# ifdef __MVS__
-#  define MAXCOL (0x3fffffffL)         /* maximum column number, 30 bits */
-# else
-#  define MAXCOL (0x7fffffffL)         /* maximum column number, 31 bits */
-# endif
+#ifdef __MVS__
+# define MAXCOL (0x3fffffffL)          /* maximum column number, 30 bits */
+# define MAXLNUM (0x3fffffffL)         /* maximum (invalid) line number */
 #else
-# define MAXCOL        (0x7fff)                /* maximum column number, 15 bits */
+# define MAXCOL (0x7fffffffL)          /* maximum column number, 31 bits */
+# define MAXLNUM (0x7fffffffL)         /* maximum (invalid) line number */
 #endif
 
 #define SHOWCMD_COLS 10                        /* columns needed by shown command */