aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTommy Allen <tommy@esdf.io>2016-08-03 17:24:26 -0400
committerTommy Allen <tommy@esdf.io>2016-08-17 17:48:15 -0400
commit8d8af6565963ac17239ec6ed620eebff6c101458 (patch)
treed0cd47df65a820e76ec9d62d94e256a78517b56c /src
parent605e74327a406682f317d07e0097690fc1e577cb (diff)
downloadrneovim-8d8af6565963ac17239ec6ed620eebff6c101458.tar.gz
rneovim-8d8af6565963ac17239ec6ed620eebff6c101458.tar.bz2
rneovim-8d8af6565963ac17239ec6ed620eebff6c101458.zip
Linting
Diffstat (limited to 'src')
-rw-r--r--src/nvim/globals.h98
-rw-r--r--src/nvim/quickfix.c20
-rw-r--r--src/nvim/screen.c11
3 files changed, 67 insertions, 62 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 9c32075d40..ddfb4f62e1 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -442,60 +442,60 @@ EXTERN int no_check_timestamps INIT(= 0); /* Don't check timestamps */
typedef enum {
HLF_8 = 0 /* Meta & special keys listed with ":map", text that is
displayed different from what it is */
- , HLF_EOB //< after the last line in the buffer
- , HLF_TERM //< terminal cursor focused
- , HLF_TERMNC //< terminal cursor unfocused
- , HLF_AT /* @ characters at end of screen, characters that
- don't really exist in the text */
- , HLF_D /* directories in CTRL-D listing */
- , HLF_E /* error messages */
- , HLF_I /* incremental search */
- , HLF_L /* last search string */
- , HLF_M /* "--More--" message */
- , HLF_CM /* Mode (e.g., "-- INSERT --") */
- , HLF_N /* line number for ":number" and ":#" commands */
- , HLF_CLN /* current line number */
- , HLF_R /* return to continue message and yes/no questions */
- , HLF_S /* status lines */
- , HLF_SNC /* status lines of not-current windows */
- , HLF_C /* column to separate vertically split windows */
- , HLF_T /* Titles for output from ":set all", ":autocmd" etc. */
- , HLF_V /* Visual mode */
- , HLF_VNC /* Visual mode, autoselecting and not clipboard owner */
- , HLF_W /* warning messages */
- , HLF_WM /* Wildmenu highlight */
- , HLF_FL /* Folded line */
- , HLF_FC /* Fold column */
- , HLF_ADD /* Added diff line */
- , HLF_CHD /* Changed diff line */
- , HLF_DED /* Deleted diff line */
- , HLF_TXD /* Text Changed in diff line */
- , HLF_CONCEAL /* Concealed text */
- , HLF_SC /* Sign column */
- , HLF_SPB /* SpellBad */
- , HLF_SPC /* SpellCap */
- , HLF_SPR /* SpellRare */
- , HLF_SPL /* SpellLocal */
- , HLF_PNI /* popup menu normal item */
- , HLF_PSI /* popup menu selected item */
- , HLF_PSB /* popup menu scrollbar */
- , HLF_PST /* popup menu scrollbar thumb */
- , HLF_TP /* tabpage line */
- , HLF_TPS /* tabpage line selected */
- , HLF_TPF /* tabpage line filler */
- , HLF_CUC /* 'cursurcolumn' */
- , HLF_CUL /* 'cursurline' */
- , HLF_MC /* 'colorcolumn' */
+ , HLF_EOB // after the last line in the buffer
+ , HLF_TERM // terminal cursor focused
+ , HLF_TERMNC // terminal cursor unfocused
+ , HLF_AT // @ characters at end of screen, characters that
+ // don't really exist in the text
+ , HLF_D // directories in CTRL-D listing
+ , HLF_E // error messages
+ , HLF_I // incremental search
+ , HLF_L // last search string
+ , HLF_M // "--More--" message
+ , HLF_CM // Mode (e.g., "-- INSERT --")
+ , HLF_N // line number for ":number" and ":#" commands
+ , HLF_CLN // current line number
+ , HLF_R // return to continue message and yes/no questions
+ , HLF_S // status lines
+ , HLF_SNC // status lines of not-current windows
+ , HLF_C // column to separate vertically split windows
+ , HLF_T // Titles for output from ":set all", ":autocmd" etc.
+ , HLF_V // Visual mode
+ , HLF_VNC // Visual mode, autoselecting and not clipboard owner
+ , HLF_W // warning messages
+ , HLF_WM // Wildmenu highlight
+ , HLF_FL // Folded line
+ , HLF_FC // Fold column
+ , HLF_ADD // Added diff line
+ , HLF_CHD // Changed diff line
+ , HLF_DED // Deleted diff line
+ , HLF_TXD // Text Changed in diff line
+ , HLF_CONCEAL // Concealed text
+ , HLF_SC // Sign column
+ , HLF_SPB // SpellBad
+ , HLF_SPC // SpellCap
+ , HLF_SPR // SpellRare
+ , HLF_SPL // SpellLocal
+ , HLF_PNI // popup menu normal item
+ , HLF_PSI // popup menu selected item
+ , HLF_PSB // popup menu scrollbar
+ , HLF_PST // popup menu scrollbar thumb
+ , HLF_TP // tabpage line
+ , HLF_TPS // tabpage line selected
+ , HLF_TPF // tabpage line filler
+ , HLF_CUC // 'cursurcolumn'
+ , HLF_CUL // 'cursurline'
+ , HLF_MC // 'colorcolumn'
, HLF_QFL // selected quickfix line
- , HLF_COUNT /* MUST be the last one */
+ , HLF_COUNT // MUST be the last one
} hlf_T;
/* The HL_FLAGS must be in the same order as the HLF_ enums!
* When changing this also adjust the default for 'highlight'. */
-#define HL_FLAGS {'8', '~', 'z', 'Z', '@', 'd', 'e', 'i', 'l', 'm', 'M', 'n', \
- 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', 'f', 'F', \
- 'A', 'C', 'D', 'T', '-', '>', 'B', 'P', 'R', 'L', '+', '=', \
- 'x', 'X', '*', '#', '_', '!', '.', 'o', 'q'}
+#define HL_FLAGS { '8', '~', 'z', 'Z', '@', 'd', 'e', 'i', 'l', 'm', 'M', 'n', \
+ 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', 'f', 'F', \
+ 'A', 'C', 'D', 'T', '-', '>', 'B', 'P', 'R', 'L', '+', '=', \
+ 'x', 'X', '*', '#', '_', '!', '.', 'o', 'q' }
EXTERN int highlight_attr[HLF_COUNT]; /* Highl. attr for each context. */
EXTERN int highlight_user[9]; /* User[1-9] attributes */
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index ba2d795eef..698f05c029 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1764,16 +1764,18 @@ void qf_list(exarg_T *eap)
vim_snprintf((char *)IObuff, IOSIZE, "%2d %s",
i, (char *)fname);
msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index
- ? hl_attr(HLF_QFL) : hl_attr(HLF_D));
- if (qfp->qf_lnum == 0)
+ ? hl_attr(HLF_QFL) : hl_attr(HLF_D));
+ if (qfp->qf_lnum == 0) {
IObuff[0] = NUL;
- else if (qfp->qf_col == 0)
- sprintf((char *)IObuff, ":%" PRId64, (int64_t)qfp->qf_lnum);
- else
- sprintf((char *)IObuff, ":%" PRId64 " col %d",
- (int64_t)qfp->qf_lnum, qfp->qf_col);
- sprintf((char *)IObuff + STRLEN(IObuff), "%s:",
- (char *)qf_types(qfp->qf_type, qfp->qf_nr));
+ } else if (qfp->qf_col == 0) {
+ vim_snprintf((char *)IObuff, IOSIZE, ":%" PRId64,
+ (int64_t)qfp->qf_lnum);
+ } else {
+ vim_snprintf((char *)IObuff, IOSIZE, ":%" PRId64 " col %d",
+ (int64_t)qfp->qf_lnum, qfp->qf_col);
+ }
+ vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE, "%s:",
+ (char *)qf_types(qfp->qf_type, qfp->qf_nr));
msg_puts_attr(IObuff, hl_attr(HLF_N));
if (qfp->qf_pattern != NULL) {
qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE);
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index fa8318d83e..61c88b5875 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -2403,11 +2403,14 @@ win_line (
if (v != 0)
line_attr = sign_get_attr((int)v, TRUE);
- /* Highlight the current line in the quickfix window. */
- if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum)
+ // Highlight the current line in the quickfix window.
+ if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum) {
line_attr = hl_attr(HLF_QFL);
- if (line_attr != 0)
- area_highlighting = TRUE;
+ }
+
+ if (line_attr != 0) {
+ area_highlighting = true;
+ }
line = ml_get_buf(wp->w_buffer, lnum, FALSE);
ptr = line;