comparison src/testdir/test_mksession.vim @ 14266:7346b2ea80d8 v8.1.0149

patch 8.1.0149: session is wrong with multiple tabs when :lcd was used commit https://github.com/vim/vim/commit/26d4b896a789e65df7ee0cf3e25056eabc523fda Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 4 22:26:28 2018 +0200 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used Problem: The generated sessions file does not restore tabs properly if :lcd was used in one of them. Solution: Create the tab pages before setting the directory. (Yee Cheng Chin, closes #3152)
author Christian Brabandt <cb@256bit.org>
date Wed, 04 Jul 2018 22:30:05 +0200
parents be8fb2fd51fc
children 5ad78e7f5b01
comparison
equal deleted inserted replaced
14265:80ca26dbc054 14266:7346b2ea80d8
160 close 160 close
161 bwipe! 161 bwipe!
162 call delete('Xtest_mks.out') 162 call delete('Xtest_mks.out')
163 endfunc 163 endfunc
164 164
165 func Test_mksession_lcd_multiple_tabs()
166 tabnew
167 tabnew
168 lcd
169 tabfirst
170 lcd
171 mksession! Xtest_mks.out
172 tabonly
173 source Xtest_mks.out
174 call assert_true(haslocaldir(), 'Tab 1 localdir')
175 tabnext 2
176 call assert_true(!haslocaldir(), 'Tab 2 localdir')
177 tabnext 3
178 call assert_true(haslocaldir(), 'Tab 3 localdir')
179 call delete('Xtest_mks.out')
180 endfunc
181
182 func Test_mksession_blank_tabs()
183 tabnew
184 tabnew
185 tabnew
186 tabnext 3
187 mksession! Xtest_mks.out
188 tabnew
189 tabnew
190 tabnext 2
191 source Xtest_mks.out
192 call assert_equal(4, tabpagenr('$'), 'session restore should restore number of tabs')
193 call assert_equal(3, tabpagenr(), 'session restore should restore the active tab')
194 call delete('Xtest_mks.out')
195 endfunc
196
197 func Test_mksession_blank_windows()
198 split
199 split
200 split
201 3 wincmd w
202 mksession! Xtest_mks.out
203 split
204 split
205 2 wincmd w
206 source Xtest_mks.out
207 call assert_equal(4, winnr('$'), 'session restore should restore number of windows')
208 call assert_equal(3, winnr(), 'session restore should restore the active window')
209 call delete('Xtest_mks.out')
210 endfunc
211
165 if has('terminal') 212 if has('terminal')
166 213
167 func Test_mksession_terminal_shell() 214 func Test_mksession_terminal_shell()
168 terminal 215 terminal
169 mksession! Xtest_mks.out 216 mksession! Xtest_mks.out