summaryrefslogtreecommitdiff
path: root/vi/vs_line.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
commitb4ed613595432ece6802d09bfabad18e09aa26f3 (patch)
treebd2db6b09b756624c1b2babdd12ea05a9dffcdaf /vi/vs_line.c
parent7cef6c685d23e4dcdf3f64b0b2ea92151e652db6 (diff)
downloadsrc-test2-b4ed613595432ece6802d09bfabad18e09aa26f3.tar.gz
src-test2-b4ed613595432ece6802d09bfabad18e09aa26f3.zip
Notes
Diffstat (limited to 'vi/vs_line.c')
-rw-r--r--vi/vs_line.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/vi/vs_line.c b/vi/vs_line.c
index 3bb8057ade92..e5778e1971e6 100644
--- a/vi/vs_line.c
+++ b/vi/vs_line.c
@@ -165,7 +165,7 @@ vs_line(SCR *sp, SMAP *smp, size_t *yp, size_t *xp)
* Lots of special cases for empty lines, but they only apply
* if we're displaying the first screen of the line.
*/
- if (skip_cols == 0)
+ if (skip_cols == 0) {
if (dne) {
if (smp->lno == 1) {
if (list_dollar) {
@@ -176,12 +176,14 @@ vs_line(SCR *sp, SMAP *smp, size_t *yp, size_t *xp)
ch = '~';
goto empty;
}
- } else
+ } else {
if (list_dollar) {
ch = '$';
empty: (void)gp->scr_addstr(sp,
KEY_NAME(sp, ch), KEY_LEN(sp, ch));
}
+ }
+ }
(void)gp->scr_clrtoeol(sp);
(void)gp->scr_move(sp, oldy, oldx);
@@ -402,11 +404,11 @@ display:
if (is_cached || no_draw)
continue;
-#define FLUSH { \
+#define FLUSH do { \
*cbp = '\0'; \
(void)gp->scr_waddstr(sp, cbuf, cbp - cbuf); \
cbp = cbuf; \
-}
+} while (0)
/*
* Display the character. We do tab expansion here because
* the screen interface doesn't have any way to set the tab