/* Switches to pane tab specified by its index if the index is valid. */ static void tabs_goto_pane(int idx) { pane_tabs_t *const ptabs = get_pane_tabs(curr_view); if(ptabs->current == idx) { return; } if(idx < 0 || idx >= (int)DA_SIZE(ptabs->tabs)) { return; } ptabs->tabs[ptabs->current].view = *curr_view; assign_preview(&ptabs->tabs[ptabs->current].preview, &curr_stats.preview); *curr_view = ptabs->tabs[idx].view; assign_preview(&curr_stats.preview, &ptabs->tabs[idx].preview); ptabs->current = idx; stats_set_quickview(curr_stats.preview.on); ui_view_schedule_redraw(curr_view); load_view_options(curr_view); (void)vifm_chdir(flist_get_dir(curr_view)); }
/* Switches to global tab specified by its index if the index is valid. */ static void tabs_goto_global(int idx) { if(current_tab == idx) { return; } //add by sim1 +++++++++++++++++++++++++++++ if(idx < 0) { idx = last_tab; } //add by sim1 ----------------------------- if(idx < 0 || idx >= (int)DA_SIZE(gtabs)) { return; } gtabs[current_tab].left.tabs[gtabs[current_tab].left.current].view = lwin; gtabs[current_tab].right.tabs[gtabs[current_tab].right.current].view = rwin; capture_global_state(>abs[current_tab]); assign_preview(>abs[current_tab].preview, &curr_stats.preview); lwin = gtabs[idx].left.tabs[gtabs[idx].left.current].view; rwin = gtabs[idx].right.tabs[gtabs[idx].right.current].view; if(gtabs[idx].active_pane != (curr_view == &rwin)) { swap_view_roles(); } curr_stats.number_of_windows = (gtabs[idx].only_mode ? 1 : 2); curr_stats.split = gtabs[idx].split; curr_stats.splitter_pos = gtabs[idx].splitter_pos; assign_preview(&curr_stats.preview, >abs[idx].preview); last_tab = current_tab; //add by sim1 current_tab = idx; stats_set_quickview(curr_stats.preview.on); ui_view_schedule_redraw(&lwin); ui_view_schedule_redraw(&rwin); load_view_options(curr_view); (void)vifm_chdir(flist_get_dir(curr_view)); }
/* Switches to pane tab specified by its index if the index is valid. */ static void tabs_goto_pane(int idx) { pane_tabs_t *const ptabs = get_pane_tabs(curr_view); if(ptabs->current == idx) { return; } //add by sim1 +++++++++++++++++++++++++++++++++++ if(idx < 0) { idx = ptabs->last; if (idx == ptabs->current) { return; } } //add by sim1 ----------------------------------- if(idx < 0 || idx >= (int)DA_SIZE(ptabs->tabs)) { return; } ptabs->tabs[ptabs->current].view = *curr_view; assign_preview(&ptabs->tabs[ptabs->current].preview, &curr_stats.preview); *curr_view = ptabs->tabs[idx].view; assign_preview(&curr_stats.preview, &ptabs->tabs[idx].preview); ptabs->last = ptabs->current; //add by sim1 ptabs->current = idx; stats_set_quickview(curr_stats.preview.on); ui_view_schedule_redraw(curr_view); load_view_options(curr_view); (void)vifm_chdir(flist_get_dir(curr_view)); //add by sim1 for test //ui_sb_msgf("tabs_goto_pane: curr=%d, last=%d, tabs=%d", ptabs->current, ptabs->last, (int)DA_SIZE(ptabs->tabs)); }