aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/textformat.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c
index fcf5a32f09..fbea1ccfb7 100644
--- a/src/nvim/textformat.c
+++ b/src/nvim/textformat.c
@@ -530,9 +530,6 @@ static bool same_leader(linenr_T lnum, int leader1_len, char *leader1_flags, int
return leader2_len == 0;
}
- char *lnum_line = NULL;
- int line_len = 0;
-
// If first leader has 'f' flag, the lines can be joined only if the
// second line does not have a leader.
// If first leader has 'e' flag, the lines can never be joined.
@@ -547,10 +544,7 @@ static bool same_leader(linenr_T lnum, int leader1_len, char *leader1_flags, int
return false;
}
if (*p == COM_START) {
- if (lnum_line == NULL) {
- lnum_line = ml_get(lnum);
- line_len = (int)strlen(lnum_line);
- }
+ int line_len = (int)strlen(ml_get(lnum));
if (line_len <= leader1_len) {
return false;
}