Mercurial > vim
diff src/ops.c @ 28773:d770568e6c98 v8.2.4911
patch 8.2.4911: the mode #defines are not clearly named
Commit: https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 7 20:01:16 2022 +0100
patch 8.2.4911: the mode #defines are not clearly named
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 May 2022 21:15:06 +0200 |
parents | bef82285dda0 |
children | d0241e74bfdb |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -294,7 +294,7 @@ shift_block(oparg_T *oap, int amount) p_ri = 0; // don't want revins in indent #endif - State = INSERT; // don't want REPLACE for State + State = MODE_INSERT; // don't want MODE_REPLACE for State block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); if (bd.is_short) return; @@ -488,7 +488,7 @@ block_insert( linenr_T lnum; // loop var int oldstate = State; - State = INSERT; // don't want REPLACE for State + State = MODE_INSERT; // don't want MODE_REPLACE for State s_len = (unsigned)STRLEN(s); for (lnum = oap->start.lnum + 1; lnum <= oap->end.lnum; lnum++) @@ -991,7 +991,7 @@ replace_character(int c) { int n = State; - State = REPLACE; + State = MODE_REPLACE; ins_char(c); State = n; // Backup to the replaced character. @@ -1842,7 +1842,7 @@ adjust_cursor_eol(void) if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL && (cur_ve_flags & VE_ONEMORE) == 0 - && !(restart_edit || (State & INSERT))) + && !(restart_edit || (State & MODE_INSERT))) { // Put the cursor on the last character in the line. dec_cursor();