aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/indent.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-20 10:35:52 +0800
committerGitHub <noreply@github.com>2023-01-20 10:35:52 +0800
commit51d082b466c59f739205a6ec0abeeee1281df68b (patch)
treedb1f73dff311596f8f3c818a7c8b81265716d375 /src/nvim/indent.c
parent0481f04ec9499ebcbc6087765349c64615d1b33d (diff)
downloadrneovim-51d082b466c59f739205a6ec0abeeee1281df68b.tar.gz
rneovim-51d082b466c59f739205a6ec0abeeee1281df68b.tar.bz2
rneovim-51d082b466c59f739205a6ec0abeeee1281df68b.zip
vim-patch:9.0.0358: 'breakindent' does not indent non-lists (#21913)
Problem: 'breakindent' does not indent non-lists with "breakindentopt=list:-1". Solution: Adjust indent computation. (Maxim Kim, closes vim/vim#11038) https://github.com/vim/vim/commit/119167265ebc7eced210a7f8ed2f4b90378f98f1 Co-authored-by: Maxim Kim <habamax@gmail.com>
Diffstat (limited to 'src/nvim/indent.c')
-rw-r--r--src/nvim/indent.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 2d1b5efb0a..ec6c72da6d 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -852,7 +852,7 @@ int get_breakindent_win(win_T *wp, char *line)
if (wp->w_briopt_list > 0) {
prev_list += wp->w_briopt_list;
} else {
- prev_list = (int)(*regmatch.endp - *regmatch.startp);
+ prev_indent = (int)(*regmatch.endp - *regmatch.startp);
}
}
vim_regfree(regmatch.regprog);
@@ -871,12 +871,8 @@ int get_breakindent_win(win_T *wp, char *line)
bri += win_col_off2(wp);
// add additional indent for numbered lists
- if (wp->w_briopt_list != 0) {
- if (wp->w_briopt_list > 0) {
- bri += prev_list;
- } else {
- bri = prev_list;
- }
+ if (wp->w_briopt_list > 0) {
+ bri += prev_list;
}
// indent minus the length of the showbreak string