File src/ui/tabs.c changed (mode: 100644) (index 40bc9b718..66024380c) |
... |
... |
clone_view(view_t *dst, view_t *src, const char path[]) |
241 |
241 |
src->list_pos - src->top_line); |
src->list_pos - src->top_line); |
242 |
242 |
} |
} |
243 |
243 |
|
|
244 |
|
(void)populate_dir_list(dst, 1); |
|
|
244 |
|
(void)populate_dir_list(dst, path == NULL); |
|
245 |
|
/* XXX: do we need to update origins or is this a leftover from before list |
|
246 |
|
* population was introduced? */ |
245 |
247 |
flist_update_origins(dst, &dst->curr_dir[0], &src->curr_dir[0]); |
flist_update_origins(dst, &dst->curr_dir[0], &src->curr_dir[0]); |
246 |
248 |
} |
} |
247 |
249 |
|
|
File tests/misc/tabs.c changed (mode: 100644) (index ac49a69ee..c3b07164c) |
... |
... |
TEST(opening_tab_in_new_location_updates_history) |
284 |
284 |
cfg_resize_histories(0); |
cfg_resize_histories(0); |
285 |
285 |
} |
} |
286 |
286 |
|
|
|
287 |
|
TEST(opening_tab_in_new_location_fetches_position_from_history) |
|
288 |
|
{ |
|
289 |
|
char cwd[PATH_MAX + 1], sandbox[PATH_MAX + 1], test_data[PATH_MAX + 1]; |
|
290 |
|
assert_non_null(get_cwd(cwd, sizeof(cwd))); |
|
291 |
|
make_abs_path(sandbox, sizeof(sandbox), SANDBOX_PATH, "", cwd); |
|
292 |
|
make_abs_path(test_data, sizeof(test_data), TEST_DATA_PATH, "", cwd); |
|
293 |
|
|
|
294 |
|
strcpy(lwin.curr_dir, sandbox); |
|
295 |
|
assert_success(populate_dir_list(&lwin, 0)); |
|
296 |
|
|
|
297 |
|
/* Emulate proper history initialization (must happen after view |
|
298 |
|
* initialization). */ |
|
299 |
|
cfg_resize_histories(5); |
|
300 |
|
cfg_resize_histories(0); |
|
301 |
|
cfg_resize_histories(5); |
|
302 |
|
curr_stats.load_stage = 2; |
|
303 |
|
curr_stats.ch_pos = 1; |
|
304 |
|
|
|
305 |
|
flist_hist_save(&lwin, test_data, "rename", 0); |
|
306 |
|
flist_hist_save(&lwin, sandbox, "..", 0); |
|
307 |
|
|
|
308 |
|
cfg.pane_tabs = 1; |
|
309 |
|
tabs_new(NULL, test_data); |
|
310 |
|
assert_string_equal("rename", get_current_file_name(&lwin)); |
|
311 |
|
|
|
312 |
|
tab_info_t tab_info; |
|
313 |
|
assert_true(tabs_get(&lwin, 0, &tab_info)); |
|
314 |
|
assert_string_equal("..", get_current_file_name(tab_info.view)); |
|
315 |
|
assert_true(tabs_get(&lwin, 1, &tab_info)); |
|
316 |
|
assert_string_equal("rename", get_current_file_name(tab_info.view)); |
|
317 |
|
|
|
318 |
|
curr_stats.ch_pos = 0; |
|
319 |
|
curr_stats.load_stage = 0; |
|
320 |
|
cfg_resize_histories(0); |
|
321 |
|
} |
|
322 |
|
|
287 |
323 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
288 |
324 |
/* vim: set cinoptions+=t0 filetype=c : */ |
/* vim: set cinoptions+=t0 filetype=c : */ |