]>
Commit | Line | Data |
---|---|---|
f3c378e8 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.0.146 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.0.146 | |
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 | |
17 | ||
18 | ||
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 | |
21 | *************** | |
22 | *** 1208,1218 **** | |
23 | { | |
24 | # ifdef FEAT_WINDOWS | |
25 | /* jump to first window containing buf if one exists ("useopen") */ | |
26 | ! if (vim_strchr(p_swb, 'o') && buf_jump_open_win(buf)) | |
27 | return OK; | |
28 | /* jump to first window in any tab page containing buf if one exists | |
29 | * ("usetab") */ | |
30 | ! if (vim_strchr(p_swb, 'a') && buf_jump_open_tab(buf)) | |
31 | return OK; | |
32 | if (win_split(0, 0) == FAIL) | |
33 | # endif | |
34 | --- 1208,1218 ---- | |
35 | { | |
36 | # ifdef FEAT_WINDOWS | |
37 | /* jump to first window containing buf if one exists ("useopen") */ | |
38 | ! if (vim_strchr(p_swb, 'o') != NULL && buf_jump_open_win(buf)) | |
39 | return OK; | |
40 | /* jump to first window in any tab page containing buf if one exists | |
41 | * ("usetab") */ | |
42 | ! if (vim_strchr(p_swb, 'a') != NULL && buf_jump_open_tab(buf)) | |
43 | return OK; | |
44 | if (win_split(0, 0) == FAIL) | |
45 | # endif | |
46 | *************** | |
47 | *** 1842,1854 **** | |
48 | if (options & GETF_SWITCH) | |
49 | { | |
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()) | |
58 | { | |
59 | if (win_split(0, 0) == FAIL) | |
60 | return FAIL; | |
61 | --- 1842,1854 ---- | |
62 | if (options & GETF_SWITCH) | |
63 | { | |
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()) | |
72 | { | |
73 | if (win_split(0, 0) == FAIL) | |
74 | return 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 | |
77 | *************** | |
78 | *** 1586,1595 **** | |
79 | } | |
80 | ||
81 | /* | |
82 | ! * If there is only one window, create a new one above the quickfix | |
83 | ! * window. | |
84 | */ | |
85 | ! if (firstwin == lastwin || !usable_win) | |
86 | { | |
87 | ll_ref = curwin->w_llist_ref; | |
88 | ||
89 | --- 1586,1615 ---- | |
90 | } | |
91 | ||
92 | /* | |
93 | ! * If no usable window is found and 'switchbuf' is set to 'usetab' | |
94 | ! * then search in other tabs. | |
95 | */ | |
96 | ! if (!usable_win && vim_strchr(p_swb, 'a') != NULL) | |
97 | ! { | |
98 | ! tabpage_T *tp; | |
99 | ! win_T *wp; | |
100 | ! | |
101 | ! FOR_ALL_TAB_WINDOWS(tp, wp) | |
102 | ! { | |
103 | ! if (wp->w_buffer->b_fnum == qf_ptr->qf_fnum) | |
104 | ! { | |
105 | ! goto_tabpage_win(tp, wp); | |
106 | ! usable_win = 1; | |
107 | ! break; | |
108 | ! } | |
109 | ! } | |
110 | ! } | |
111 | ! | |
112 | ! /* | |
113 | ! * If there is only one window and is the quickfix window, create a new | |
114 | ! * one above the quickfix window. | |
115 | ! */ | |
116 | ! if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win) | |
117 | { | |
118 | ll_ref = curwin->w_llist_ref; | |
119 | ||
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 | |
122 | *************** | |
123 | *** 668,669 **** | |
124 | --- 668,671 ---- | |
125 | { /* Add new patch number below this line */ | |
126 | + /**/ | |
127 | + 146, | |
128 | /**/ | |
129 | ||
130 | -- | |
131 | hundred-and-one symptoms of being an internet addict: | |
132 | 80. At parties, you introduce your spouse as your "service provider." | |
133 | ||
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 /// |