Mercurial > vim
diff src/termlib.c @ 31804:50555279168b
patch 9.0.1234: the code style has to be checked manually
Commit: https://github.com/vim/vim/commit/ebfec1c531f32d424bb2aca6e7391ef3bfcbfe20
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 22 21:14:53 2023 +0000
patch 9.0.1234: the code style has to be checked manually
Problem: The code style has to be checked manually.
Solution: Add basic code style checks in a test. Fix or avoid uncovered
problems.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Jan 2023 22:15:04 +0100 |
parents | 4c5eec1ef612 |
children |
line wrap: on
line diff
--- a/src/termlib.c +++ b/src/termlib.c @@ -286,15 +286,19 @@ tgetstr(char *id, char **buf) if (!*tmp) break; - if (_match(id, tmp) == len) { + if (_match(id, tmp) == len) + { tmp += len; // find '=' '@' or '#' if (*tmp == '@') // :xx@: entry for tc return 0; // deleted entry hold= *buf; - while (*++tmp && *tmp != ':') { // not at end of field - switch(*tmp) { + while (*++tmp && *tmp != ':') // not at end of field + { + switch(*tmp) + { case '\\': // Expand escapes here - switch(*++tmp) { + switch(*++tmp) + { case 0: // ignore backslashes tmp--; // at end of entry break; // shouldn't happen @@ -401,11 +405,16 @@ tgoto( bufp = buffer; ptr = cm; - while (*ptr) { - if ((c = *ptr++) != '%') { // normal char + while (*ptr) + { + if ((c = *ptr++) != '%') // normal char + { *bufp++ = c; - } else { // % escape - switch(c = *ptr++) { + } + else + { // % escape + switch(c = *ptr++) + { case 'd': // decimal bufp = _addfmt(bufp, "%d", line); line = col; @@ -430,7 +439,8 @@ tgoto( if (line == '\t' || // these are line == '\n' || // chars that line == '\004' || // UNIX hates - line == '\0') { + line == '\0') + { line++; // so go to next pos if (reverse == (line == col)) addup=1; // and mark UP @@ -472,7 +482,8 @@ tgoto( } if (addup) // add upline - if (UP) { + if (UP) + { ptr=UP; while (VIM_ISDIGIT(*ptr) || *ptr == '.') ptr++; @@ -483,7 +494,8 @@ tgoto( } if (addbak) // add backspace - if (BC) { + if (BC) + { ptr=BC; while (VIM_ISDIGIT(*ptr) || *ptr == '.') ptr++; @@ -536,17 +548,20 @@ tputs( counter, // digits atol(const char *); - if (VIM_ISDIGIT(*cp)) { + if (VIM_ISDIGIT(*cp)) + { counter = 0; frac = 1000; while (VIM_ISDIGIT(*cp)) counter = counter * 10L + (long)(*cp++ - '0'); if (*cp == '.') - while (VIM_ISDIGIT(*++cp)) { + while (VIM_ISDIGIT(*++cp)) + { counter = counter * 10L + (long)(*cp++ - '0'); frac = frac * 10; } - if (*cp!='*') { // multiply by affected lines + if (*cp!='*') // multiply by affected lines + { if (affcnt>1) affcnt = 1; } else