On Fri, Sep 16, 2011 at 9:06 AM, Jakson Alves de Aquino
<[email protected]> wrote:
> On Thu, Sep 15, 2011 at 5:56 PM, Donald Allen <[email protected]> wrote:
>> I tried this with the same build of vim as I used for the example in
>> my original post, current as of last night (on the East Coast of the
>> US). Setting the filetype to R does indeed produce the correct result,
>> but after a 3-second delay. Doing the same in emacs/viper is
>> essentially instantaneous.
> [...]
>> Thanks for your response. Despite the performance issue, which I'm
>> confident can be fixed, your R version is a definite improvement over
>> the awk version.
>
> I agree that the indent/r.vim script is very slow, but I don't know
> how to improve the speed. For each line to be indented, the script has
> to calculate what was the indent level of the last command, but the
> last command is not always the line above. So the algorithm goes
> slowly upwards until finding the beginning of the last command. I
> think it would be necessary to take a different approach.

I haven't read your code, but perhaps remember the indent level of the
'last command' as you make your forward pass over the indentation
region?

Having said that, I will observe that I've found problems with the
emacs/viper awk indentation. They took awhile to turn up, but there
are problems there, too. Your indenter, slow though it may be, is the
most consistently correct of any of them and I'm now using it, which
allows me to return to vim, which, as I said earlier, I prefer.

/Don

>
> Best regards,
>
> Jakson
>
> --
> 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 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