Saturday, June 13, 2015

Re: Formatting of lists and paragraphs containing numbers with fo+=n

On Sun, Jun 14, 2015 at 12:43:11AM +1000, Erik Christiansen wrote:
> Ugggh, yes, that's a dog's breakfast. This is what happens to that text
> when I hit ^W ( mapped to gq} ) while formatoptions=rontcql :
>
> > sdasda sadas daskldj alksdj lkjasdk ljasdlk jlakds jlkdas jlkasdj
> > lkajs 1000. aslda dkjasdkl jaklsdjklasjdlkasj kljads jasdlk jalkjdsa
> > ljaskl asdjk kjasldjlkjklj kljaslkdjakljsd lkjadslkjaskldjklaj ljlkj
> > 1. kljkljkljlkjklklj sad kjdjkjlkj asd klj klj lkj klj klj klj klj
> > klj kljkl jl jkl asjdlkjaklsjdklajdkljasslkjdljasdkljadlkjakldjs
> > lkj 2003. asdasd jlk dasd akdj ljaslkdj alkjsj lkjdskljala
> > jlasjdkl jkjslkjd lkasjdlk jlkasjdklaj slkjsadlkj aklsjdlkaj
> > dkjaslkdj klajsd jaslkdji

> Even though quoted, Vim still restores the malformatted numbered list,
> unfazed by your sneaky look-alikes. So, what do you need to do to also
> hold your mouth right? My guess is that:
>
> 'formatlistpat' 'flp' string (default: "^\s*\d\+[\]:.)}\t ]\s*")
>
> isn't cutting it. In comparison, mine is:
>
> let &flp = '^\s*\(\d\|\a\)\.\s*'
>
> (That may be mentioned in the 2011 thread, IIRC. It's past midnight
> here, so I'm taking shortcuts, before I fall asleep.)

Are you sure you have no "+" after the parenthesis? The flp above
doesn't allow item numbers greater than 9 and disallows normal numbers
smaller than 10. After adding the "+" the situation goes bad back again.

--
Marcin Szewczyk http://wodny.org
mailto:Marcin.Szewczyk@wodny.borg <- remove b / usuĊ„ b
xmpp:wodny@ubuntu.pl xmpp:wodny@jabster.pl

--
--
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/d/optout.

No comments:

Post a Comment