On 5/14/07, Václav Šmilauer <[EMAIL PROTECTED]> wrote:
Hello,

I submit patch that implements the 'breakindent' feature. It is on vim todo
list, since the moment I tried a few years ago (see e.g.
http://marc.info/?l=vim-dev&m=109921292009721&w=1). Picture says what it's
about (showbreak is aligned with first non-whitespace):

http://beta.arcig.cz/~eudoxos/vim7/breakindent1.png
http://beta.arcig.cz/~eudoxos/vim7/breakindent2.png

I tried to address all Bram's comments he had to the original patch, like
coding style, functionality in diff mode, selections etc. I had to change a
few prototypes to pass line number.

There is one bug and some (easily fixable) limitations:

* BUG: there is some weird interaction with quickfix window, where very
rarely there is the "ml_get(): invalid line number" error. I think it is
caused by passing wrong line number thgouth the *chartabsize* & family
routines (line in the main buffer interpreted as line in the quickfix window
or something like that), but I am not sure.

* No test case. This will be added once there is enough interest from
developers (there _is_ documentation).

* The bri_min variable is not exposed to userspace yet, is set to 20 in the
code. If the rest is considered ready for inclusion, I will add a
user-serrable variable for that.

The patch is against current svn (vim7, rev. 288). Any comments are welcome.

I played with the patch. Works smoothly, I did not find any deficiencies.

I have one wish though.

It would be nice if I could specificy additional indent for continuation lines.
You make indent for continuation line *EQUAL* to indent of the 1st screen line.
Let's say  you have 3 consequitive long lines with same indent, and
each lines wrapped into 4 screen lines. With current 'breakindent'
patch, you see 8 lines
with *same* indent. It's not that easy to see beginning of each long lines.
If breakindent would be numeric value N which meant assign indent K+N
to continuation indent, where K is indent of the line itself. Current
breakindent corresponds to N==0. But I'd probably prefer N=1 or N==2.

Just my 2 cents
Thanks
Yakov
****************** nobreakindent
 line1line1line1line1
line1line1line1line
 line2line2line2line2
line2line2line2line
****************** breakindent=0
 line1line1line1line1
 line1line1line1line
 line2line2line2line2
 line2line2line2line
****************** breakindent=2
 line1line1line1line1
   line1line1line1line
 line2line2line2line2
   line2line2line2line
******************

Reply via email to