Patch 8.1.2361
Problem:    MS-Windows: test failures related to VIMDLL.
Solution:   Adjust code and tests. (Ken Takata, closes #5283)
Files:      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


*** ../vim-8.1.2360/src/evalfunc.c      2019-11-29 21:07:55.108371775 +0100
--- src/evalfunc.c      2019-11-29 23:11:18.237470377 +0100
***************
*** 3355,3361 ****
  #ifdef FEAT_SEARCHPATH
        "file_in_path",
  #endif
! #ifdef FEAT_FILTERPIPE
        "filterpipe",
  #endif
  #ifdef FEAT_FIND_ID
--- 3355,3361 ----
  #ifdef FEAT_SEARCHPATH
        "file_in_path",
  #endif
! #if defined(FEAT_FILTERPIPE) && !defined(VIMDLL)
        "filterpipe",
  #endif
  #ifdef FEAT_FIND_ID
***************
*** 3819,3824 ****
--- 3819,3828 ----
        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
      }
  
      rettv->vval.v_number = n;
*** ../vim-8.1.2360/src/ex_cmds.c       2019-11-16 13:50:18.777646751 +0100
--- src/ex_cmds.c       2019-11-29 23:11:18.237470377 +0100
***************
*** 1068,1073 ****
--- 1068,1076 ----
      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,1119 ****
        shell_flags |= SHELL_DOOUT;
  
  #ifdef FEAT_FILTERPIPE
!     if (!do_in && do_out && !p_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)
      {
        /* 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)
      {
        /* Use a pipe to write stdin and fetch stdout of the command, do not
         * use a temp file. */
--- 1103,1127 ----
        shell_flags |= SHELL_DOOUT;
  
  #ifdef FEAT_FILTERPIPE
! # 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 && !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 && !stmp)
      {
        /* Use a pipe to write stdin and fetch stdout of the command, do not
         * use a temp file. */
*** ../vim-8.1.2360/src/gui_w32.c       2019-11-19 23:01:24.643827472 +0100
--- src/gui_w32.c       2019-11-29 23:11:18.237470377 +0100
***************
*** 5746,5751 ****
--- 5746,5759 ----
      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,5820 ****
--- 5823,5833 ----
      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;
*** ../vim-8.1.2360/src/mbyte.c 2019-11-21 17:13:12.628361301 +0100
--- src/mbyte.c 2019-11-29 23:11:18.241470356 +0100
***************
*** 4789,4795 ****
  # define USE_IMSTATUSFUNC (*p_imsf != NUL)
  #endif
  
! #if defined(FEAT_EVAL) && (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM))
      static void
  call_imactivatefunc(int active)
  {
--- 4789,4796 ----
  # define USE_IMSTATUSFUNC (*p_imsf != NUL)
  #endif
  
! #if defined(FEAT_EVAL) && \
!     (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL))
      static void
  call_imactivatefunc(int active)
  {
***************
*** 6454,6464 ****
  
  #else /* !defined(FEAT_XIM) */
  
! # ifdef IME_WITHOUT_XIM
  static int im_was_set_active = FALSE;
  
      int
  im_get_status(void)
  {
  #  if defined(FEAT_EVAL)
      if (USE_IMSTATUSFUNC)
--- 6455,6469 ----
  
  #else /* !defined(FEAT_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,6474 ****
--- 6473,6483 ----
  }
  
      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,6487 ****
  #  endif
  }
  
! #  ifdef FEAT_GUI
      void
  im_set_position(int row UNUSED, int col UNUSED)
  {
--- 6490,6496 ----
  #  endif
  }
  
! #  if defined(FEAT_GUI) && !defined(VIMDLL)
      void
  im_set_position(int row UNUSED, int col UNUSED)
  {
*** ../vim-8.1.2360/src/menu.c  2019-10-13 16:43:35.956359658 +0200
--- src/menu.c  2019-11-29 23:11:18.241470356 +0100
***************
*** 685,691 ****
            if (        addtearoff
                    && *next_name
                    && vim_strchr(p_go, GO_TEAROFF) != NULL
!                   && menu_is_menubar(name))
            {
                char_u          *tearpath;
  
--- 685,695 ----
            if (        addtearoff
                    && *next_name
                    && vim_strchr(p_go, GO_TEAROFF) != NULL
!                   && menu_is_menubar(name)
! #  ifdef VIMDLL
!                   && (gui.in_use || gui.starting)
! #  endif
!                   )
            {
                char_u          *tearpath;
  
*** ../vim-8.1.2360/src/proto.h 2019-11-21 17:13:12.628361301 +0100
--- src/proto.h 2019-11-29 23:14:05.236606504 +0100
***************
*** 177,182 ****
--- 177,187 ----
  # 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"
*** ../vim-8.1.2360/src/testdir/test_highlight.vim      2019-11-09 
23:26:36.905570965 +0100
--- src/testdir/test_highlight.vim      2019-11-29 23:11:18.241470356 +0100
***************
*** 519,525 ****
    if !exists('+termguicolors')
      return
    endif
!   if has('vtp') && !has('vcon')
      " Win32: 'guicolors' doesn't work without virtual console.
      call assert_fails('set termguicolors', 'E954:')
      return
--- 519,525 ----
    if !exists('+termguicolors')
      return
    endif
!   if has('vtp') && !has('vcon') && !has('gui_running')
      " Win32: 'guicolors' doesn't work without virtual console.
      call assert_fails('set termguicolors', 'E954:')
      return
*** ../vim-8.1.2360/src/version.c       2019-11-29 22:06:44.229570907 +0100
--- src/version.c       2019-11-29 23:12:36.245061975 +0100
***************
*** 739,740 ****
--- 739,742 ----
  {   /* Add new patch number below this line */
+ /**/
+     2361,
  /**/

-- 
Drink wet cement and get really stoned.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201911292215.xATMFqmb024499%40masaka.moolenaar.net.

Raspunde prin e-mail lui