diff options
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 3e49d7845d..55366842b0 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3451,13 +3451,13 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, sub_firstline = NULL; - /* - * ~ in the substitute pattern is replaced with the old pattern. - * We do it here once to avoid it to be replaced over and over again. - * But don't do it when it starts with "\=", then it's an expression. - */ - if (!(sub[0] == '\\' && sub[1] == '=')) + // ~ in the substitute pattern is replaced with the old pattern. + // We do it here once to avoid it to be replaced over and over again. + // But don't do it when it starts with "\=", then it's an expression. + assert(sub != NULL); + if (!(sub[0] == '\\' && sub[1] == '=')) { sub = regtilde(sub, p_magic); + } // Check for a match on each line. // If preview: limit to max('cmdwinheight', viewport). |