Patch 9.0.0469
Problem:    Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution:   Skip win_fix_cursor if called when cmdwin is open or closing.
            (Luuk van Baal, closes #11134)
Files:      src/ex_getln.c, src/globals.h, src/window.c


*** ../vim-9.0.0468/src/ex_getln.c      2022-09-14 17:27:33.148117751 +0100
--- src/ex_getln.c      2022-09-15 12:33:01.200832998 +0100
***************
*** 4405,4411 ****
      int                       save_restart_edit = restart_edit;
      int                       save_State = State;
      int                       save_exmode = exmode_active;
-     int                       save_p_spsc;
  #ifdef FEAT_RIGHTLEFT
      int                       save_cmdmsg_rl = cmdmsg_rl;
  #endif
--- 4405,4410 ----
***************
*** 4645,4654 ****
        wp = curwin;
        set_bufref(&bufref, curbuf);
  
!       save_p_spsc = p_spsc;
!       p_spsc = TRUE;
        win_goto(old_curwin);
-       p_spsc = save_p_spsc;
  
        // win_goto() may trigger an autocommand that already closes the
        // cmdline window.
--- 4644,4651 ----
        wp = curwin;
        set_bufref(&bufref, curbuf);
  
!       skip_win_fix_cursor = TRUE;
        win_goto(old_curwin);
  
        // win_goto() may trigger an autocommand that already closes the
        // cmdline window.
***************
*** 4662,4667 ****
--- 4659,4665 ----
  
        // Restore window sizes.
        win_size_restore(&winsizes);
+       skip_win_fix_cursor = FALSE;
      }
  
      ga_clear(&winsizes);
*** ../vim-9.0.0468/src/globals.h       2022-09-14 16:09:53.344308323 +0100
--- src/globals.h       2022-09-15 12:40:00.688587888 +0100
***************
*** 1737,1739 ****
--- 1737,1744 ----
  // While executing a regexp and set to OPTION_MAGIC_ON or OPTION_MAGIC_OFF 
this
  // overrules p_magic.  Otherwise set to OPTION_MAGIC_NOT_SET.
  EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET);
+ 
+ #ifdef FEAT_CMDWIN
+ // Skip win_fix_cursor() call for 'nosplitscroll' when cmdwin is closed.
+ EXTERN int skip_win_fix_cursor INIT(= FALSE);
+ #endif
*** ../vim-9.0.0468/src/window.c        2022-09-14 01:27:17.628593488 +0100
--- src/window.c        2022-09-15 12:39:41.752609342 +0100
***************
*** 6410,6415 ****
--- 6410,6419 ----
  
      if (wp->w_buffer->b_ml.ml_line_count < wp->w_height)
        return;
+ #ifdef FEAT_CMDWIN
+     if (skip_win_fix_cursor)
+       return;
+ #endif
  
      so = MIN(wp->w_height / 2, so);
      // Check if cursor position is above topline or below botline.
*** ../vim-9.0.0468/src/version.c       2022-09-15 12:20:12.881894422 +0100
--- src/version.c       2022-09-15 12:35:15.980816524 +0100
***************
*** 705,706 ****
--- 705,708 ----
  {   /* Add new patch number below this line */
+ /**/
+     469,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
81. At social functions you introduce your husband as "my domain server."

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/20220915114359.14DE91C0EE2%40moolenaar.net.

Raspunde prin e-mail lui