Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tweekmonster committed Aug 17, 2016
1 parent 605e743 commit 8d8af65
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 62 deletions.
98 changes: 49 additions & 49 deletions src/nvim/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
20 changes: 11 additions & 9 deletions src/nvim/quickfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 7 additions & 4 deletions src/nvim/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d8af65

Please sign in to comment.