On 03/14/2015 12:13 AM, Bram Moolenaar wrote:
>
> Xavier de Gaye wrote:
>
>> The Vim netbeans interface is not tabpage aware and does not check the
>> 'switchbuf' option. So, even when a buffer is already loaded in the window of
>> a tab, placing an annotation in this buffer will cause the buffer to be
loaded
>> in the current window of the current tab instead of moving to the tab where
>> the buffer is already loaded.
>>
>> The attached patch fixes this.
>
> Thanks! So no documentation changes needed?
Here is an updated patch with documentation.
The 'setBufferNumber' command is one of the commands that set the buffer as
the current buffer, but it uses the ':buffer' Vim command and the ':buffer'
command ignores the 'switchbuf' option.
Should the ':buffer' command be fixed ?
Note that the documentation recommends using 'putBufferNumber' instead of
'setBufferNumber'.
-- Xavier
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
--- a/runtime/doc/netbeans.txt
+++ b/runtime/doc/netbeans.txt
@@ -1,4 +1,4 @@
-*netbeans.txt* For Vim version 7.4. Last change: 2012 Jan 26
+*netbeans.txt* For Vim version 7.4. Last change: 2015 Mar 14
VIM REFERENCE MANUAL by Gordon Prieur et al.
@@ -306,7 +306,12 @@
or generic. Generic messages use a bufID of zero. NOTE: this
buffer ID is assigned by the IDE, it is not Vim's buffer
number. The bufID must be a sequentially rising number,
- starting at one.
+ starting at one. When the 'switchbuf' option is set to
+ "usetab" and the "bufID" buffer is not found in the current
+ tab page, the netbeans commands and functions that set this
+ buffer as the current buffer will jump to the first open
+ window that contains this buffer in other tab pages instead of
+ replacing the buffer in the current window.
seqno The IDE uses a sequence number for Commands and Functions. A
Reply must use the sequence number of the Function that it is
diff --git a/src/netbeans.c b/src/netbeans.c
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -2691,8 +2691,17 @@
static void
nb_set_curbuf(buf_T *buf)
{
- if (curbuf != buf && buf_jump_open_win(buf) == NULL)
+ if (curbuf != buf) {
+# ifdef FEAT_WINDOWS
+ if (swb_flags & SWB_USETAB) {
+ if (buf_jump_open_tab(buf))
+ return;
+ }
+ else if (buf_jump_open_win(buf))
+ return;
+# endif
set_curbuf(buf, DOBUF_GOTO);
+ }
}
/*