4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When 'switchbuf' is set to "usetab" and the current tab has only a
12 quickfix window, jumping to an error always opens a new window.
13 Also, when the buffer is open in another tab page it's not found.
14 Solution: Check for the "split" value of 'switchbuf' properly. Search in
15 other tab pages for the desired buffer. (Yegappan Lakshmanan)
16 Files: src/buffer.c, src/quickfix.c
19 *** ../vim-7.0.145/src/buffer.c Sat Sep 9 14:51:43 2006
20 --- src/buffer.c Fri Oct 20 20:08:49 2006
25 /* jump to first window containing buf if one exists ("useopen") */
26 ! if (vim_strchr(p_swb, 'o') && buf_jump_open_win(buf))
28 /* jump to first window in any tab page containing buf if one exists
30 ! if (vim_strchr(p_swb, 'a') && buf_jump_open_tab(buf))
32 if (win_split(0, 0) == FAIL)
37 /* jump to first window containing buf if one exists ("useopen") */
38 ! if (vim_strchr(p_swb, 'o') != NULL && buf_jump_open_win(buf))
40 /* jump to first window in any tab page containing buf if one exists
42 ! if (vim_strchr(p_swb, 'a') != NULL && buf_jump_open_tab(buf))
44 if (win_split(0, 0) == FAIL)
48 if (options & GETF_SWITCH)
50 /* use existing open window for buffer if wanted */
51 ! if (vim_strchr(p_swb, 'o')) /* useopen */
52 wp = buf_jump_open_win(buf);
53 /* use existing open window in any tab page for buffer if wanted */
54 ! if (vim_strchr(p_swb, 'a')) /* usetab */
55 wp = buf_jump_open_tab(buf);
56 /* split window if wanted ("split") */
57 ! if (wp == NULL && vim_strchr(p_swb, 't') && !bufempty())
59 if (win_split(0, 0) == FAIL)
62 if (options & GETF_SWITCH)
64 /* use existing open window for buffer if wanted */
65 ! if (vim_strchr(p_swb, 'o') != NULL) /* useopen */
66 wp = buf_jump_open_win(buf);
67 /* use existing open window in any tab page for buffer if wanted */
68 ! if (vim_strchr(p_swb, 'a') != NULL) /* usetab */
69 wp = buf_jump_open_tab(buf);
70 /* split window if wanted ("split") */
71 ! if (wp == NULL && vim_strchr(p_swb, 'l') != NULL && !bufempty())
73 if (win_split(0, 0) == FAIL)
75 *** ../vim-7.0.145/src/quickfix.c Tue Sep 5 15:36:30 2006
76 --- src/quickfix.c Fri Oct 20 20:05:00 2006
82 ! * If there is only one window, create a new one above the quickfix
85 ! if (firstwin == lastwin || !usable_win)
87 ll_ref = curwin->w_llist_ref;
93 ! * If no usable window is found and 'switchbuf' is set to 'usetab'
94 ! * then search in other tabs.
96 ! if (!usable_win && vim_strchr(p_swb, 'a') != NULL)
101 ! FOR_ALL_TAB_WINDOWS(tp, wp)
103 ! if (wp->w_buffer->b_fnum == qf_ptr->qf_fnum)
105 ! goto_tabpage_win(tp, wp);
113 ! * If there is only one window and is the quickfix window, create a new
114 ! * one above the quickfix window.
116 ! if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
118 ll_ref = curwin->w_llist_ref;
120 *** ../vim-7.0.145/src/version.c Tue Oct 17 22:40:14 2006
121 --- src/version.c Fri Oct 20 20:11:58 2006
125 { /* Add new patch number below this line */
131 hundred-and-one symptoms of being an internet addict:
132 80. At parties, you introduce your spouse as your "service provider."
134 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
135 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
136 \\\ download, build and distribute -- http://www.A-A-P.org ///
137 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///