On 30/07/10 17:51, Hari G wrote:
Hi,

Gvim opens a new tab just next to the current tab by default. Is it
acceptable to open the new tab at the end of the tabline by default?
Recently somebody was asking for this in the vim_use group. A patch to
get this behaviour follows:

diff -r de6d730223f7 src/window.c
--- a/src/window.c      Fri Jul 30 13:21:50 2010 +0530
+++ b/src/window.c      Fri Jul 30 21:02:20 2010 +0530
@@ -3458,6 +3458,17 @@
        }
        else
        {
+           if (after == 0)
+           {
+               /* Put new tab page after the last tab page */
+               for (tp = first_tabpage; ; tp = tp->tp_next)
+               {
+                  /* cycle to the last tab */
+                   if (tp->tp_next == NULL) break;
+               }
+               newtp->tp_next = NULL;
+               tp->tp_next = newtp;
+           }
            if (after>  0)
            {
                /* Put new tab page before tab page "after". */
@@ -3465,9 +3476,9 @@
                for (tp = first_tabpage; tp->tp_next != NULL
                                        &&  n<  after; tp = tp->tp_next)
                    ++n;
+               newtp->tp_next = tp->tp_next;
+               tp->tp_next = newtp;
            }
-           newtp->tp_next = tp->tp_next;
-           tp->tp_next = newtp;
        }
        win_init_size();
        firstwin->w_winrow = tabline_height();

Comments/suggestions on this?

/harig


Hm, I suppose both behaviours might have their fans, but opening next to the current tab is the current behaviour, therefore I think that in the absence of an overwhelming obvious-to-all reason to do otherwise, it should be kept for the sake of compatibility with previous versions.

If you want to open the new tab at the end, you can always do either

        :tablast | tabnew filename.ext

or

        :9999tab split


Best regards,
Tony.
--
Psychiatrists say that one out of four people are mentally ill.  Check
three friends.  If they're OK, you're it.

--
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

Raspunde prin e-mail lui