[patch] breakindent patch for 7.4.x

280 views
Skip to first unread message

Ken Takata

unread,
Oct 5, 2013, 6:39:00 AM10/5/13
to vim...@googlegroups.com
Hi,

The breakindent patch was originally written by Václav Šmilauer and it is
currently maintained at https://retracile.net/wiki/VimBreakIndent .
The latest version is for 7.3.944 and it can't be applied to 7.4.x.
There is an updated version by Taylor Hedberg but it also can't be applied
to 7.4.x. (https://groups.google.com/d/msg/vim_dev/JfbTedtmSuc/KIkfD9cRhgYJ)

So I have updated the breakindent patch for 7.4.x. I also fixed coding style.
There were many lines that exceeds 80 columns. And I also fixed a TODO in
strdisplaywidth(). Now strdisplaywidth() has the third parameter which can
specify a line number.
Attached patch can be applied to 7.4.035 and 7.4.050.

Regards,
Ken Takata
vim-7.4.035-breakindent.patch

Amadeus Demarzi

unread,
Oct 6, 2013, 4:59:13 PM10/6/13
to vim...@googlegroups.com
I am interested in this patch for MacVim, unfortunately when I apply it, I get the following errors.

Non verbose output:
~/Development/macvim: git apply file.patch
error: patch failed: src/option.c:8501
error: src/option.c: patch does not apply

Verbose output:
~/Development/macvim: git apply -v file.patch
Checking patch runtime/doc/eval.txt...
Hunk #1 succeeded at 1957 (offset -1 lines).
Hunk #2 succeeded at 5604 (offset -9 lines).
Hunk #3 succeeded at 6413 (offset -8 lines).
Checking patch runtime/doc/options.txt...
Hunk #1 succeeded at 1205 (offset -2 lines).
Hunk #2 succeeded at 4706 (offset 89 lines).
Checking patch runtime/doc/tags...
Checking patch runtime/optwin.vim...
Checking patch src/charset.c...
Checking patch src/edit.c...
Hunk #2 succeeded at 1961 (offset 10 lines).
Hunk #3 succeeded at 6770 (offset 15 lines).
Hunk #4 succeeded at 7126 (offset 15 lines).
Hunk #5 succeeded at 9788 (offset 34 lines).
Hunk #6 succeeded at 9818 (offset 34 lines).
Hunk #7 succeeded at 10074 (offset 34 lines).
Checking patch src/eval.c...
Hunk #2 succeeded at 17618 (offset -10 lines).
Checking patch src/ex_cmds.c...
Checking patch src/getchar.c...
Checking patch src/gui_beval.c...
Checking patch src/misc1.c...
Hunk #1 succeeded at 476 (offset 8 lines).
Hunk #2 succeeded at 1998 (offset 8 lines).
Hunk #3 succeeded at 2054 (offset 8 lines).
Hunk #4 succeeded at 2066 (offset 8 lines).
Hunk #5 succeeded at 9103 (offset 14 lines).
Hunk #6 succeeded at 9127 (offset 14 lines).
Hunk #7 succeeded at 9167 (offset 14 lines).
Checking patch src/misc2.c...
Checking patch src/normal.c...
Hunk #1 succeeded at 4540 (offset 5 lines).
Hunk #2 succeeded at 4613 (offset 5 lines).
Hunk #3 succeeded at 4643 (offset 5 lines).
Checking patch src/ops.c...
Hunk #6 succeeded at 5209 (offset 15 lines).
Hunk #7 succeeded at 5278 (offset 15 lines).
Hunk #8 succeeded at 6791 (offset 15 lines).
Checking patch src/option.c...
Hunk #1 succeeded at 190 (offset 3 lines).
Hunk #2 succeeded at 660 (offset 9 lines).
error: while searching for:
}
curwin->w_nrwidth_line_count = 0;
}
#endif

else if (pp == &curbuf->b_p_tw)

error: patch failed: src/option.c:8501
error: src/option.c: patch does not apply
Checking patch src/option.h...
Hunk #1 succeeded at 1071 (offset 14 lines).
Checking patch src/proto/charset.pro...
Checking patch src/proto/misc1.pro...
Checking patch src/regexp.c...
Checking patch src/regexp_nfa.c...
Hunk #1 succeeded at 6345 (offset 38 lines).
Checking patch src/screen.c...
Checking patch src/structs.h...
Checking patch src/ui.c...
Hunk #1 succeeded at 3196 (offset 21 lines).

Is there any way to quickly tweak this patch or make a copy of it that would work on MacVim?

Cheers,
Amadeus

Charles

unread,
Oct 6, 2013, 9:06:50 PM10/6/13
to vim_dev

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

Thanks.

Just want to add note that the patch line ending is in DOS, so anyone applying the patch may want to convert the line endings first.

Ken Takata

unread,
Oct 6, 2013, 11:17:36 PM10/6/13
to vim...@googlegroups.com
Hi Amadeus,

2013/10/07 Mon 5:59:13 UTC+9 Amadeus Demarzi wrote:
> I am interested in this patch for MacVim, unfortunately when I apply it, I get the following errors.
>
> Non verbose output:
> ~/Development/macvim: git apply file.patch
> error: patch failed: src/option.c:8501
> error: src/option.c: patch does not apply

It seems that it is caused by this "#if defined(FEAT_TRANSPARENCY)" block:
https://github.com/b4winckler/macvim/blob/9fc84fb9b0cb8abaf3bce42f82bb956b255a9120/src/option.c#L8613

Reducing context lines may solve this problem.
Please try the attached patch.

The difference from the previous patch is:
$ diff vim-7.4.035-breakindent.patch vim-7.4.035-breakindent-macvim.patch
775c775
< @@ -8501,6 +8533,16 @@
---
> @@ -8501,5 +8533,15 @@
791d790


< else if (pp == &curbuf->b_p_tw)

Regards,
Ken Takata

vim-7.4.035-breakindent-macvim.patch

Amadeus Demarzi

unread,
Oct 7, 2013, 12:53:48 AM10/7/13
to vim...@googlegroups.com
Awesome, works like a charm, thanks!
Reply all
Reply to author
Forward
0 new messages