summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-21 22:14:18 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-21 22:14:18 +0100
commit7bae0b1bc84a95d565ffab38cf7f82ad21c656b6 (patch)
tree2d724ddd855892ef212f14924e2cc04feafa5abe /src/indent.c
parent94d9f4fa65bce6f116cf89bfdabdf5a06509056f (diff)
downloadvim-git-7bae0b1bc84a95d565ffab38cf7f82ad21c656b6.tar.gz
patch 8.1.2331: the option.c file is still very bigv8.1.2331
Problem: The option.c file is still very big. Solution: Move a few functions to where they fit better. (Yegappan Lakshmanan, closes #4895)
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c
index 8d574c8a7..70bb81b0d 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -839,6 +839,50 @@ get_number_indent(linenr_T lnum)
#if defined(FEAT_LINEBREAK) || defined(PROTO)
/*
+ * This is called when 'breakindentopt' is changed and when a window is
+ * initialized.
+ */
+ int
+briopt_check(win_T *wp)
+{
+ char_u *p;
+ int bri_shift = 0;
+ long bri_min = 20;
+ int bri_sbr = FALSE;
+
+ p = wp->w_p_briopt;
+ while (*p != NUL)
+ {
+ if (STRNCMP(p, "shift:", 6) == 0
+ && ((p[6] == '-' && VIM_ISDIGIT(p[7])) || VIM_ISDIGIT(p[6])))
+ {
+ p += 6;
+ bri_shift = getdigits(&p);
+ }
+ else if (STRNCMP(p, "min:", 4) == 0 && VIM_ISDIGIT(p[4]))
+ {
+ p += 4;
+ bri_min = getdigits(&p);
+ }
+ else if (STRNCMP(p, "sbr", 3) == 0)
+ {
+ p += 3;
+ bri_sbr = TRUE;
+ }
+ if (*p != ',' && *p != NUL)
+ return FAIL;
+ if (*p == ',')
+ ++p;
+ }
+
+ wp->w_p_brishift = bri_shift;
+ wp->w_p_brimin = bri_min;
+ wp->w_p_brisbr = bri_sbr;
+
+ return OK;
+}
+
+/*
* Return appropriate space number for breakindent, taking influencing
* parameters into account. Window must be specified, since it is not
* necessarily always the current one.