Hi.
I use a lot of mksession. I fixed an issue that occurs.
Reproduce the problem:
edit Makefile
exe 10
normal! zt
20
tabnew
tabnext 1
Open the Makefile, jump to line number 10,
go to the top of the screen that line,
line number 20 to move the cursor,
open the tab, go back to the original screen.
Scroll position will be shifted tabnew exists.
The result is correct if there is no tabnew.
I enclose a short patch.
The world has chanded in Vim.
Also my life.
--------
Thanks.
Nobuhiro Takasaki
--
--
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].
For more options, visit https://groups.google.com/d/optout.
diff -r 01f2b7e6b33c src/window.c
--- a/src/window.c Thu Apr 24 17:12:33 2014 +0200
+++ b/src/window.c Fri Apr 25 21:14:58 2014 +0900
@@ -5748,10 +5748,11 @@
wp->w_wrow -= sline;
}
}
- set_topline(wp, lnum);
- }
-
- if (wp == curwin)
+ if (sline != 0)
+ set_topline(wp, lnum);
+ }
+
+ if (wp == curwin && sline != 0)
{
if (p_so)
update_topline();