[slim-vim] Vim+ECL patch
Brad Beveridge
brad.beveridge at gmail.com
Mon May 22 09:56:10 CDT 2006
> In the long term ... I'm not sure what I'd prefer. Part of me says
> "make all C Vim functions continue to take 1..n+1, and change all Lisp
> Vim functions to take 0..n, and make the Lisp functions translate to
> the C functions' expected coordinate scheme". But the other part of
> me says "change all C Lisp interface functions to take 0..n, and have
> them translate to other Vim functions' expected coordinate scheme".
>
> The first option keeps all C functions (both normal Vim functions and
> Lisp-interface "internal" functions) using the same coordinate scheme,
> but makes all Lisp functions that talk to them have to do 1- and 1+
> all over the place (or call some "fix-it" function on their
> coordinates first, or something). The second option makes the Lisp
> functions easier, but makes the C functions have to do the same
> translations, and makes them inconsistent with the rest of Vim.
>
> Thoughts, anyone?
I agree that we need to be consistant. I think that I would prefer
the Lisp code to access lines on a 1..n basis. To append a line, you
replace-line and n+1. I _think_ that is consistant with internal Vim,
which is probably a good thing. To be honest, I didn't think too hard
about this when I "fixed" it. At the moment there is only a small
part of my code (the Gray stream to a buffer) that uses this. I
changed the Gray stream implementation from calling a Vim script to
append to the buffer to using pure Lisp - it sped the stream up a lot.
I was doing this to try to avoid the bug where the input listener
crashes after a while. It didn't fix it :)
So unless somebody makes the Vim ECL buffer handling consistant today,
I will probably do that tonight. Gotta do something other than bang
my head against this input listener bug.
Cheers
Brad
More information about the slim-vim
mailing list