Mercurial > vim
comparison src/macros.h @ 15636:6f1c7e9a6393 v8.1.0826
patch 8.1.0826: too many #ifdefs
commit https://github.com/vim/vim/commit/29ddebef4038d2d2b3bc9d8d3b0109f4046d6fbf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 26 17:28:26 2019 +0100
patch 8.1.0826: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_VIRTUALEDIT. Adds about 10Kbyte to the code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 26 Jan 2019 17:30:15 +0100 |
parents | 62b3805506b3 |
children | 7fad90423bd2 |
comparison
equal
deleted
inserted
replaced
15635:c51d2a06f5f9 | 15636:6f1c7e9a6393 |
---|---|
19 #define PBYTE(lp, c) (*(ml_get_buf(curbuf, (lp).lnum, TRUE) + (lp).col) = (c)) | 19 #define PBYTE(lp, c) (*(ml_get_buf(curbuf, (lp).lnum, TRUE) + (lp).col) = (c)) |
20 | 20 |
21 /* | 21 /* |
22 * Position comparisons | 22 * Position comparisons |
23 */ | 23 */ |
24 #ifdef FEAT_VIRTUALEDIT | 24 #define LT_POS(a, b) (((a).lnum != (b).lnum) \ |
25 # define LT_POS(a, b) (((a).lnum != (b).lnum) \ | |
26 ? (a).lnum < (b).lnum \ | 25 ? (a).lnum < (b).lnum \ |
27 : (a).col != (b).col \ | 26 : (a).col != (b).col \ |
28 ? (a).col < (b).col \ | 27 ? (a).col < (b).col \ |
29 : (a).coladd < (b).coladd) | 28 : (a).coladd < (b).coladd) |
30 # define LT_POSP(a, b) (((a)->lnum != (b)->lnum) \ | 29 #define LT_POSP(a, b) (((a)->lnum != (b)->lnum) \ |
31 ? (a)->lnum < (b)->lnum \ | 30 ? (a)->lnum < (b)->lnum \ |
32 : (a)->col != (b)->col \ | 31 : (a)->col != (b)->col \ |
33 ? (a)->col < (b)->col \ | 32 ? (a)->col < (b)->col \ |
34 : (a)->coladd < (b)->coladd) | 33 : (a)->coladd < (b)->coladd) |
35 # define EQUAL_POS(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && ((a).coladd == (b).coladd)) | 34 #define EQUAL_POS(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && ((a).coladd == (b).coladd)) |
36 # define CLEAR_POS(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0;} | 35 #define CLEAR_POS(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0;} |
37 #else | |
38 # define LT_POS(a, b) (((a).lnum != (b).lnum) \ | |
39 ? ((a).lnum < (b).lnum) : ((a).col < (b).col)) | |
40 # define LT_POSP(a, b) (((a)->lnum != (b)->lnum) \ | |
41 ? ((a)->lnum < (b)->lnum) : ((a)->col < (b)->col)) | |
42 # define EQUAL_POS(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col)) | |
43 # define CLEAR_POS(a) {(a)->lnum = 0; (a)->col = 0;} | |
44 #endif | |
45 | 36 |
46 #define LTOREQ_POS(a, b) (LT_POS(a, b) || EQUAL_POS(a, b)) | 37 #define LTOREQ_POS(a, b) (LT_POS(a, b) || EQUAL_POS(a, b)) |
47 | 38 |
48 /* | 39 /* |
49 * VIM_ISWHITE() is used for "^" and the like. It differs from isspace() | 40 * VIM_ISWHITE() is used for "^" and the like. It differs from isspace() |