On 4 August 2010 12:20, björn <[email protected]> wrote:
> On 3 August 2010 23:28, Lech Lorens wrote:
>> On 03-Aug-2010 Michael Trim wrote:
>>> The attached patch adds two options which together allow dropped files
>>> to always be loaded as tabs instead of in the current window or a
>>> split window. Files loaded via the Windows shell extension ("Edit
>>> with existing Vim...") should also be affected, since the shell
>>> extension sends a WM_DROPFILES message to the exisiting Vim window.
>>>
>>> This seems like something that should be possible with AutoCmds or
>>> something, but my Googlings [1] didn't come up with anything except
>>> other people wanting this type of behaviour [2].
>>>
>>> It would be nice if this patch could find its way into 7.3, but I
>>> realise it is a bit late.
>>>
>>> [1] http://www.google.com/search?q=vim+open+dropped+file+new+tab
>>> [2]
>>> http://stackoverflow.com/questions/1891513/can-i-force-gvim-to-open-dragged-in-files-in-a-new-tab
>>
>>
>> Aren't the 'dropnewtab' and 'dropsplit' mutually exclusive? If so,
>> wouldn't it be better if there was a single setting (e.g.
>> 'drop') which could have a value of either "split" or "newtab"?
>
> ...and to be consistent with startup arguments (-o/-O/-p) there should
> also be a value for "vertical split". This is how MacVim works
> (although this behavior is implemented as a Preference in the MacVim
> app and not as a Vim option).
>
> I haven't looked at the patch but if implemented as one option (as
> Lech suggested) then I'd support the inclusion of such a patch.
> (Which would mean I could get rid of my hack in MacVim to support this
> behavior.)
>
> Björn
The two options as implemented in the patch are not mutually
exclusive, though they could perhaps be better named:
- nodropnewtab + nodropsplit (default) = current behaviour, where
dropped files will be opened in a (horizontally) split window if Ctrl
is held or the current buffer has unsaved changes.
- nodropnewtab + dropsplit = dropped files are always opened in a
split window, unless Ctrl is held.
- dropnewtab + nodropsplit = same as the current behaviour but with
tabs, i.e. dropped files will be opened in a tab if Ctrl is held or
the current buffer has unsaved changes.
- dropnewtab + dropsplit = dropped files are always opened in a new
tab, unless Ctrl is held.
The patch as it stands is quite simple and only introduces a couple of
lines of extra code, most of the rest being for the config options and
documentation. It would be fairly simple to add vertical splitting as
well.
Perhaps the options could be:
dropsplittype = { vertical, horizontal, tab }
dropsplitalways = boolean
I'm not sure that it makes sense to combine the options, as they are
handled separately anyway and all the possible combinations are valid.
--Mike
--
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