feat: use 'formatlistpat' length for breakindent#8594
feat: use 'formatlistpat' length for breakindent#8594habamax wants to merge 10 commits intovim:masterfrom habamax:master
Conversation
Provided 'set briopt+=list:-1' use length of the matched 'formatlistpat' as additional indent to align contents of the list item.
|
looks quite good already. Will post some information on how to test later. |
Otherwise it looks like:
* hello world
next line has too much indent
Showbreak len is substracted after indent for the list is
calculated for proper alignment.
|
@chrisbra should I put "explicit brackets" there? It looks like your code I didn't change :) |
|
And for macos build similar one for |
if (vim_regexec(®match, line, 0))
if (wp->w_briopt_list > 0)
bri += wp->w_briopt_list;
else
bri = (*regmatch.endp - *regmatch.startp);
vim_regfree(regmatch.regprog);
}please add braces after the top level if (vim_regexec(®match, line, 0))
{
if (wp->w_briopt_list > 0)
bri += wp->w_briopt_list;
else
bri = (*regmatch.endp - *regmatch.startp);
}
vim_regfree(regmatch.regprog);
} |
Codecov Report
@@ Coverage Diff @@
## master #8594 +/- ##
==========================================
- Coverage 90.05% 90.02% -0.03%
==========================================
Files 150 150
Lines 168649 168450 -199
==========================================
- Hits 151874 151646 -228
- Misses 16775 16804 +29
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
@chrisbra I am not sure if multilevel list test is correct, could you check it pls? |
Now with local test run first.
With setl briopt+=list:-1 we get double list opts in the setting.
|
I think it is ready from my side, @chrisbra if you have any other suggestions, let me know, thank you! |
|
looks good, thanks |
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim#8594)
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.
Problem: Cannot use 'formatlistpat' for breakindent. Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594) vim/vim@f674b35 Port get_showbreak_value() from patch v8.1.2281 to avoid breaking changes when porting older patches.

Provided 'set briopt+=list:-1' use length of the matched 'formatlistpat' as additional indent to align contents of the list item.
@chrisbra pls check it, related to your PR #8564
PS, not sure how to write a proper test though.