Saturday, April 20, 2013

Re: Consider lines containing a tab a paragraph boundary

Christian Brabandt wrote:

> On Fr, 12 Apr 2013, zappathustra@free.Fr wrote:
>
> > Indeed. Actually, the bar should be preceded by three backslashes, if
> > I'm not mistaken (two denote a single one, and the last escapes the
> > bar).
> >
> > In the meanwhile I've found that if you're on a paragraph line, you
> > can't jump to paragraph lines just below if you're one the first
> > character. E.g.:
> >
> > set paragraphs=foo
> >
> > with file:
> >
> > foo
> > foo
> >
> > foo
> >
> > If you're on the first "f", you'll jump to the last line; if you're on
> > the first "o", you'll jump to the second line... With file:
> >
> > foo
> > foo
> > foo
> >
> > you won't jump anywhere from the first "f". Normally, "}" with the
> > usual 'paragraphs':
> >
> > - jumps to the next blank line when on a non-blank line;
> > - jumps to the next blank line following a non-blank line when on a
> > blank line;
> > - jumps to the end of the file if there is no blank line below the
> > current one.
> >
> > (``Blank line'' here of course means a real blank lines or the nroff
> > macros.)
> >
> > With Christian's patch, I think that behavior should be mimicked by
> > simply replacing ``(non-)blank line'' with ``line (not) matching the
> > option''.
>
> Here is an updated toy patch. I also made the 'section' and 'para'
> settings global-local.
>
> Note, there is one problem and I don't know how to approach it.
>
> Consider this file
> ,----
> |
> | foo
> | foo
> | foo
> |
> `----
>
> If the cursor is on the first foo and you have set para=/foo pressing }
> will jump after the whole 'foo' block. If the cursor is on the first o
> and you press '}' it will first move to the second 'foo' line and on
> next press of '}' it will move over the whole block.
>
> I have no clue, how to detect, whether the cursor is on a block of
> consecutive lines matching the 'para' or 'section' pattern and in that
> case jump over the complete block. Perhaps, when using a regular
> expression for 'para' and 'sections', we shouldn't jump over consecutive
> matching lines at all?
>
> Apart from that inconsistency, the patch seems to work for me.

Thanks.

I wonder if changing 'paragraphs' and 'sections' into a regexp that
matches at what's between paragraphs is sufficient. How about this
style with two paragraphs:

Blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
Blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah

The examples with "foo" are a bit misleading, can't we use some
real-world examples?

--
Some of the well known MS-Windows errors:
ESLEEP Operator fell asleep
ENOERR No error yet
EDOLLAR OS too expensive
EWINDOWS MS-Windows loaded, system in danger

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" 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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: