On 4/13/09, Tony Mechelynck wrote:
>
>On 14/04/09 00:50, Matt Wozniski wrote:
>>
>> On 4/13/09, Gary Johnson wrote:
>>>
>>> On 2009-04-14, Lech Lorens wrote:
>>>>  The attached patch changes the default 'foldmethod' for the quickfix
>>>>  window to manual.
>>>
>>>
>>> I'm a little concerned about applying such fine tuning of individual
>>>   window behavior to the source code.  If there is a general rule in
>>>   vim for the option values that windows inherit when they are
>>>   created, I think we should use that general rule unless there is a
>>>   compelling reason to do otherwise.
>>
>> Well... I'm not sure I agree.  The quickfix, location list, and
>> command-line windows are already very distinct from any other windows
>> you can create.  They behave differently, they have special commands
>> that open and close them, they have key bindings that only apply in
>> that one type of window.  It seems reasonable that the code for these
>> types of windows should be as centralized as possible - doing it all
>> in vimscript would be a noble goal, but is certainly beyond the
>> abilities that are currently available in vimscript, and barring that,
>> I think that all of their special-case behavior should be held in the
>> source code.
>
> Why do you think it's impossible to define quickfix folding in
> vimscript? IMHO, a "reasonable" folding scheme would be to fold qf lines
> together if they refer to errors/matches in the same source file. I
> don't think that would be hard to implement in vimscript, with a
> well-crafted "expression" folding method.

No, you misinterpreted what I said.  It's definitely possible to define
the *folding* behavior for quickfix windows in vimscript, but it's not
possible to create a window that behaves like a quickfix window in
vimscript without using the quickfix commands.  For instance, there's no
way to emulate what :make does in vimscript without duplicating all of
the 'errorformat' logic that's currently in C.

> As for the command-line window, that's even simpler: I believe it
> deserves no folding at all.

Again, I wasn't talking specifically about folding, I was talking about
all the behavior for a command-line window.  You can't use vimscript to
create a window that the cursor can't leave, other than by going through
the special-casing in C for a command-line window.

> Also, moving everything to C code means harder to debug,

Yep

> harder to change,

Yep

> and practically impossible to customize.

Well... no.  This would only change the default foldmethod, an autocmd
could still change the behavior from the default to match the user's
preferences.  And, a default of "no folding" with possible user-supplied
vimscript to make it possible to fold related lines together is probably
better than defaulting to folding related things.

> I'm in favour of having the maximum possible in vimscript, and only
> move to C code what cannot be done in vimscript, or only at an
> unacceptable performance loss.

I'm in favor of keeping all of the logic for the special window types in
one place.  I agree that it would be better if that place could be
vimscript, but it can't.

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui