I notice the following about the ":tab" command. Are they intended?
1) When "filename" is already open in a window, ":tab drop filename"
_moves_ that window to the bottom in the _current_ tab. I would have
expected it to open the window without moving it, ignoring the ":tab"
prefix since in this case Vim doesn't attempt to open a new split-window.
2) ":tab help" opens $VIMRUNTIME/doc/help.txt in a new tab even if there
already is a help window. I would have expected it to reuse the current
help window.
Rationale for the above: I read the following under ":help :tab":
> Execute {cmd} and when it opens a new window open a new tab
> page instead. Doesn't work for |:diffsplit|, |:diffpatch|,
> |:execute| and |:normal|.
The key phrase for my reasoning is "when it opens a new window" in the
help text above. If the command doesn't try to open any new window
(i.e., to split it off, otherwise it would be an "old" window), I would
expect the ":tab" prefix to have no effect, like the ":to[pleft]" and
":bo[tright]" prefix have no effect when there is no split (for
instance, ":bot help" opens the existing help window, if there is one
anywhere in the current tab, and doesn't move it to the bottom).
Best regards,
Tony.
--
There's nothing better than good sex. But bad sex? A peanut butter
and jelly sandwich is better than bad sex.
-- Billy Joel
> Using gvim 7.2.108 (Huge) with GTK2/Gnome2 GUI
>
> I notice the following about the ":tab" command. Are they intended?
>
> 1) When "filename" is already open in a window, ":tab drop filename"
> _moves_ that window to the bottom in the _current_ tab. I would have
> expected it to open the window without moving it, ignoring the ":tab"
> prefix since in this case Vim doesn't attempt to open a new split-window.
Yes, that would be better.
> 2) ":tab help" opens $VIMRUNTIME/doc/help.txt in a new tab even if there
> already is a help window. I would have expected it to reuse the current
> help window.
Well, if you use ":tab help" instead of ":help" the user probably wants
a tab page with help. But if there is an existing tab page for help it
should be re-used.
> Rationale for the above: I read the following under ":help :tab":
> > Execute {cmd} and when it opens a new window open a new tab
> > page instead. Doesn't work for |:diffsplit|, |:diffpatch|,
> > |:execute| and |:normal|.
>
> The key phrase for my reasoning is "when it opens a new window" in the
> help text above. If the command doesn't try to open any new window
> (i.e., to split it off, otherwise it would be an "old" window), I would
> expect the ":tab" prefix to have no effect, like the ":to[pleft]" and
> ":bo[tright]" prefix have no effect when there is no split (for
> instance, ":bot help" opens the existing help window, if there is one
> anywhere in the current tab, and doesn't move it to the bottom).
The ":tab" modifier was implemented in a generic way. But there are
exceptions where it doesn't quite work as expected. Tab page switching
can be a bit complicated.
--
From "know your smileys":
:^[/ mean-smiley-with-cigarette
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Currently I have a cabbrev to change h to bot h (actually, in Vim 7 "and
later" it is an <expr> abbrev in order to avoid expanding except at the
start of a : line). I was wondering what would happen if I decided to
expand to tab h instead.
Experiment shows that ":tab help" not only opens a new tab even if there
already is a help window in the current tab, it always opens a new tab
even when there already exists a tab with _only_ a help window and
nothing else (and even if that help window is open on the same helptag).
Best regards,
Tony.
--
Uppers are no longer stylish, methedrine is almost as rare as pure acid
or DMT. "Consciousness Expansion" went out with LBJ and it is worth
noting, historically, that downers came in with Nixon.
-- Dr. Hunter S. Thompson