]> granicus.if.org Git - vim/commitdiff
patch 8.1.2361: MS-Windows: test failures related to VIMDLL v8.1.2361
authorBram Moolenaar <Bram@vim.org>
Fri, 29 Nov 2019 22:15:25 +0000 (23:15 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 29 Nov 2019 22:15:25 +0000 (23:15 +0100)
Problem:    MS-Windows: test failures related to VIMDLL.
Solution:   Adjust code and tests. (Ken Takata, closes #5283)

src/evalfunc.c
src/ex_cmds.c
src/gui_w32.c
src/mbyte.c
src/menu.c
src/proto.h
src/testdir/test_highlight.vim
src/version.c

index 254b2a9baab0ec15c67f2e663a7609cd4dd7e759..a071ad8b654bce4aae791dd7a8d742a846ae7826 100644 (file)
@@ -3355,7 +3355,7 @@ f_has(typval_T *argvars, typval_T *rettv)
 #ifdef FEAT_SEARCHPATH
        "file_in_path",
 #endif
-#ifdef FEAT_FILTERPIPE
+#if defined(FEAT_FILTERPIPE) && !defined(VIMDLL)
        "filterpipe",
 #endif
 #ifdef FEAT_FIND_ID
@@ -3818,6 +3818,10 @@ f_has(typval_T *argvars, typval_T *rettv)
 #ifdef FEAT_CLIPBOARD
        else if (STRICMP(name, "clipboard_working") == 0)
            n = clip_star.available;
+#endif
+#ifdef VIMDLL
+       else if (STRICMP(name, "filterpipe") == 0)
+           n = gui.in_use || gui.starting;
 #endif
     }
 
index 5615adcaa5de8430928345c3d20872d8a444ea05..95766683c8fcc9fd5a0629ab331f08dad2312c53 100644 (file)
@@ -1068,6 +1068,9 @@ do_filter(
     pos_T      orig_start = curbuf->b_op_start;
     pos_T      orig_end = curbuf->b_op_end;
     int                save_lockmarks = cmdmod.lockmarks;
+#ifdef FEAT_FILTERPIPE
+    int                stmp = p_stmp;
+#endif
 
     if (*cmd == NUL)       /* no filter command */
        return;
@@ -1100,20 +1103,25 @@ do_filter(
        shell_flags |= SHELL_DOOUT;
 
 #ifdef FEAT_FILTERPIPE
-    if (!do_in && do_out && !p_stmp)
+# ifdef VIMDLL
+    if (!gui.in_use && !gui.starting)
+       stmp = 1;   // Console mode doesn't support filterpipe.
+# endif
+
+    if (!do_in && do_out && !stmp)
     {
        /* Use a pipe to fetch stdout of the command, do not use a temp file. */
        shell_flags |= SHELL_READ;
        curwin->w_cursor.lnum = line2;
     }
-    else if (do_in && !do_out && !p_stmp)
+    else if (do_in && !do_out && !stmp)
     {
        /* Use a pipe to write stdin of the command, do not use a temp file. */
        shell_flags |= SHELL_WRITE;
        curbuf->b_op_start.lnum = line1;
        curbuf->b_op_end.lnum = line2;
     }
-    else if (do_in && do_out && !p_stmp)
+    else if (do_in && do_out && !stmp)
     {
        /* Use a pipe to write stdin and fetch stdout of the command, do not
         * use a temp file. */
index 429b4570d1e28cdb8c06d00a779e52a1f20c6edd..d5dfeff685282b2370595f431037003b22f48a20 100644 (file)
@@ -5746,6 +5746,14 @@ im_set_active(int active)
     HIMC       hImc;
     static HIMC        hImcOld = (HIMC)0;
 
+# ifdef VIMDLL
+    if (!gui.in_use && !gui.starting)
+    {
+       mbyte_im_set_active(active);
+       return;
+    }
+# endif
+
     if (pImmGetContext)            /* if NULL imm32.dll wasn't loaded (yet) */
     {
        if (p_imdisable)
@@ -5815,6 +5823,11 @@ im_get_status(void)
     int                status = 0;
     HIMC       hImc;
 
+# ifdef VIMDLL
+    if (!gui.in_use && !gui.starting)
+       return mbyte_im_get_status();
+# endif
+
     if (pImmGetContext && (hImc = pImmGetContext(s_hwnd)) != (HIMC)0)
     {
        status = pImmGetOpenStatus(hImc) ? 1 : 0;
index 6ecf53bc098d04ab145165815b60d8fd9b9cf06a..4dfcfc952b7db202cdf35ae431619b9425c45a62 100644 (file)
@@ -4789,7 +4789,8 @@ iconv_end(void)
 # define USE_IMSTATUSFUNC (*p_imsf != NUL)
 #endif
 
-#if defined(FEAT_EVAL) && (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM))
+#if defined(FEAT_EVAL) && \
+    (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL))
     static void
 call_imactivatefunc(int active)
 {
@@ -6454,11 +6455,15 @@ xim_get_status_area_height(void)
 
 #else /* !defined(FEAT_XIM) */
 
-# ifdef IME_WITHOUT_XIM
+# if defined(IME_WITHOUT_XIM) || defined(VIMDLL)
 static int im_was_set_active = FALSE;
 
     int
+#  ifdef VIMDLL
+mbyte_im_get_status(void)
+#  else
 im_get_status(void)
+#  endif
 {
 #  if defined(FEAT_EVAL)
     if (USE_IMSTATUSFUNC)
@@ -6468,7 +6473,11 @@ im_get_status(void)
 }
 
     void
+#  ifdef VIMDLL
+mbyte_im_set_active(int active_arg)
+#  else
 im_set_active(int active_arg)
+#  endif
 {
 #  if defined(FEAT_EVAL)
     int            active = !p_imdisable && active_arg;
@@ -6481,7 +6490,7 @@ im_set_active(int active_arg)
 #  endif
 }
 
-#  ifdef FEAT_GUI
+#  if defined(FEAT_GUI) && !defined(VIMDLL)
     void
 im_set_position(int row UNUSED, int col UNUSED)
 {
index e55cab675842c11d3e3c81ee7698814f6986f9bc..26327941cf6cba7fc4747425b3064a41dcf4427f 100644 (file)
@@ -685,7 +685,11 @@ add_menu_path(
            if (        addtearoff
                    && *next_name
                    && vim_strchr(p_go, GO_TEAROFF) != NULL
-                   && menu_is_menubar(name))
+                   && menu_is_menubar(name)
+#  ifdef VIMDLL
+                   && (gui.in_use || gui.starting)
+#  endif
+                   )
            {
                char_u          *tearpath;
 
index 452f9e22f542f9f77bb6e25f24fb88243b36c52e..c358a1d02689b6eaac710ff84366ae96d63516b6 100644 (file)
@@ -177,6 +177,11 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void
 # include "mouse.pro"
 # include "move.pro"
 # include "mbyte.pro"
+# ifdef VIMDLL
+// Function name differs when VIMDLL is defined
+int mbyte_im_get_status(void);
+void mbyte_im_set_active(int active_arg);
+# endif
 # include "normal.pro"
 # include "ops.pro"
 # include "option.pro"
index 83bada5226295d66449112578ab257676a62f08f..c6aa3a2bf43498748df8a444209ec11bb5b4bb9a 100644 (file)
@@ -519,7 +519,7 @@ func Test_termguicolors()
   if !exists('+termguicolors')
     return
   endif
-  if has('vtp') && !has('vcon')
+  if has('vtp') && !has('vcon') && !has('gui_running')
     " Win32: 'guicolors' doesn't work without virtual console.
     call assert_fails('set termguicolors', 'E954:')
     return
index ad9f3ad60f5ec8ab1cc099aff1310acd339033ab..5747085512f0deb9cd37684ead3ba6f30e5606c6 100644 (file)
@@ -737,6 +737,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2361,
 /**/
     2360,
 /**/