Mercurial > vim
diff src/clipboard.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 | 9849df834f1d |
children | 89e1d67814a9 |
line wrap: on
line diff
--- a/src/clipboard.c +++ b/src/clipboard.c @@ -77,7 +77,7 @@ clip_update_selection(Clipboard_T *clip) pos_T start, end; // If visual mode is only due to a redo command ("."), then ignore it - if (!redo_VIsual_busy && VIsual_active && (State & NORMAL)) + if (!redo_VIsual_busy && VIsual_active && (State & MODE_NORMAL)) { if (LT_POS(VIsual, curwin->w_cursor)) { @@ -142,8 +142,8 @@ clip_own_selection(Clipboard_T *cbd) // selected area. There is no specific redraw command for this, // just redraw all windows on the current buffer. if (cbd->owned - && (get_real_state() == VISUAL - || get_real_state() == SELECTMODE) + && (get_real_state() == MODE_VISUAL + || get_real_state() == MODE_SELECT) && (cbd == &clip_star ? clip_isautosel_star() : clip_isautosel_plus()) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)) @@ -195,8 +195,8 @@ clip_lose_selection(Clipboard_T *cbd) // area. There is no specific redraw command for this, just redraw all // windows on the current buffer. if (was_owned - && (get_real_state() == VISUAL - || get_real_state() == SELECTMODE) + && (get_real_state() == MODE_VISUAL + || get_real_state() == MODE_SELECT) && (cbd == &clip_star ? clip_isautosel_star() : clip_isautosel_plus()) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) @@ -214,7 +214,7 @@ clip_lose_selection(Clipboard_T *cbd) static void clip_copy_selection(Clipboard_T *clip) { - if (VIsual_active && (State & NORMAL) && clip->available) + if (VIsual_active && (State & MODE_NORMAL) && clip->available) { clip_update_selection(clip); clip_free_selection(clip);