[vim/vim] cursor moves when cmdwin is closed when 'splitscroll' (PR #11134)

3 views
Skip to first unread message

luukvbaal

unread,
Sep 14, 2022, 2:51:19 PM9/14/22
to vim/vim, Subscribed

Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution: Save and restore cursor position when opening and closing cmdwin.

Reverts change to ex_getln.c from e697d48, keep the test. Can you confirm this works @mityu.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/11134

Commit Summary

  • a7a8d33 cursor moves when cmdwin is closed when 'splitscroll'

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134@github.com>

codecov[bot]

unread,
Sep 14, 2022, 3:01:22 PM9/14/22
to vim/vim, Subscribed

Codecov Report

Merging #11134 (a7a8d33) into master (e697d48) will decrease coverage by 0.45%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@

##           master   #11134      +/-   ##

==========================================

- Coverage   81.61%   81.15%   -0.46%     

==========================================

  Files         162      152      -10     

  Lines      188258   178257   -10001     

  Branches    42786    40471    -2315     

==========================================

- Hits       153645   144668    -8977     

+ Misses      22136    20937    -1199     

- Partials    12477    12652     +175     
Flag Coverage Δ
huge-clang-none 82.69% <100.00%> (-0.01%) ⬇️
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 0.29% <0.00%> (ø)
linux 81.15% <100.00%> (-1.32%) ⬇️
mingw-x86-HUGE ?
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ex_getln.c 83.50% <100.00%> (-2.32%) ⬇️
src/if_perl.xs 54.85% <0.00%> (-17.93%) ⬇️
src/regexp_nfa.c 80.41% <0.00%> (-9.30%) ⬇️
src/arabic.c 85.86% <0.00%> (-8.70%) ⬇️
src/typval.c 84.95% <0.00%> (-8.29%) ⬇️
src/regexp_bt.c 78.48% <0.00%> (-7.48%) ⬇️
src/vim9execute.c 83.83% <0.00%> (-7.39%) ⬇️
src/json.c 77.74% <0.00%> (-5.49%) ⬇️
src/vim9instr.c 77.39% <0.00%> (-5.09%) ⬇️
src/vim9compile.c 87.36% <0.00%> (-4.83%) ⬇️
... and 134 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/c1247182753@github.com>

mityu

unread,
Sep 14, 2022, 3:33:29 PM9/14/22
to vim/vim, Subscribed

I found one problem with this patch at least. With win_execute() function, you can change cursor positions on other windows while in cmdwin. However, with this patch, cursor position changes for the current window by user-side scripts will be reverted when leaving cmdwin.
Example:

  • `vim -u NONE --cmd "set nosplitscroll | call setline(1, range(&lines))"
  • Type Gq::call win_execute(winnr('#')->win_getid(), 'call cursor(1, 1)')<CR><C-w>q

Without this patch, the cursor position will be (1, 1), but with this patch, it's not.

  • With this patch
    with-11134

  • Without this patch
    without-11134


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/c1247214739@github.com>

luukvbaal

unread,
Sep 14, 2022, 3:43:00 PM9/14/22
to vim/vim, Subscribed

Right. What we actually want to do is delay the win_fix_cursor until after the win_restore_size in open_cmdwin, or skip it altogether. Not sure how to achieve this. Would have to pass along args to a a lot of functions I think.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/c1247223694@github.com>

luukvbaal

unread,
Sep 14, 2022, 5:26:18 PM9/14/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 889890a cursor moves when cmdwin is closed when 'splitscroll'


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/push/11026285855@github.com>

luukvbaal

unread,
Sep 14, 2022, 5:40:51 PM9/14/22
to vim/vim, Subscribed

Or set a global of course. I think the latest commit should fix the cursor issue without side-effects.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/c1247329495@github.com>

luukvbaal

unread,
Sep 14, 2022, 6:58:28 PM9/14/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • cf52c37 cursor moves when cmdwin is closed when 'splitscroll' is off

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/push/11026899755@github.com>

mityu

unread,
Sep 15, 2022, 6:41:22 AM9/15/22
to vim/vim, Subscribed

It seems that this patch works well. LGTM.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/c1247920343@github.com>

Bram Moolenaar

unread,
Sep 15, 2022, 7:44:09 AM9/15/22
to vim/vim, Subscribed

Closed #11134 via 3735f11.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11134/issue_event/7394181831@github.com>

Reply all
Reply to author
Forward
0 new messages