summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-06-04 22:06:24 +0000
committerBram Moolenaar <Bram@vim.org>2005-06-04 22:06:24 +0000
commit75c50c46a69d25ac94a55bae8a9642316d52be00 (patch)
tree2cefbd38adf2f259b314f40ff4c310713e07d4d1 /src/edit.c
parent51485f06246966898f7c00e2e53b1ba4c6855cf7 (diff)
downloadvim-75c50c46a69d25ac94a55bae8a9642316d52be00.zip
updated for version 7.0079
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/edit.c b/src/edit.c
index f4682c083..ebfe7fd69 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4568,6 +4568,7 @@ auto_format(trailblank, prev_line)
char_u *old;
char_u *new, *pnew;
int wasatend;
+ int cc;
if (!has_format_option(FO_AUTO))
return;
@@ -4587,11 +4588,12 @@ auto_format(trailblank, prev_line)
if (*old != NUL && !trailblank && wasatend)
{
dec_cursor();
- if (!WHITECHAR(gchar_cursor())
- && curwin->w_cursor.col > 0
- && has_format_option(FO_ONE_LETTER))
+ cc = gchar_cursor();
+ if (!WHITECHAR(cc) && curwin->w_cursor.col > 0
+ && has_format_option(FO_ONE_LETTER))
dec_cursor();
- if (WHITECHAR(gchar_cursor()))
+ cc = gchar_cursor();
+ if (WHITECHAR(cc))
{
curwin->w_cursor = pos;
return;
@@ -4672,10 +4674,12 @@ check_auto_format(end_insert)
int end_insert; /* TRUE when ending Insert mode */
{
int c = ' ';
+ int cc;
if (did_add_space)
{
- if (!WHITECHAR(gchar_cursor()))
+ cc = gchar_cursor();
+ if (!WHITECHAR(cc))
/* Somehow the space was removed already. */
did_add_space = FALSE;
else