Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Syntastic Segment #451

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions powerline/config_files/colorschemes/vim/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"line_current_symbol": { "fg": "gray1", "bg": "gray10" },
"virtcol_current_gradient": { "fg": "dark_GREEN_Orange_red", "bg": "gray10" },
"col_current": { "fg": "gray6", "bg": "gray10" },
"modified_buffers": { "fg": "brightyellow", "bg": "gray2" }
"modified_buffers": { "fg": "brightyellow", "bg": "gray2" },
"syntastic_segment": { "fg": "brightestred", "bg": "gray2", "attr": ["bold"] }
},
"mode_translations": {
"nc": {
Expand Down Expand Up @@ -68,7 +69,8 @@
"groups": {
"mode": { "fg": "darkestcyan", "bg": "white", "attr": ["bold"] },
"background:divider": { "fg": "darkcyan", "bg": "darkestblue" },
"branch:divider": { "fg": "darkcyan", "bg": "darkblue" }
"branch:divider": { "fg": "darkcyan", "bg": "darkblue" },
"syntastic_segment": { "fg": "white", "bg": "darkestblue", "attr": ["bold"] }
}
},
"v": {
Expand Down
6 changes: 4 additions & 2 deletions powerline/config_files/colorschemes/vim/solarized.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"line_current": { "fg": "gray13", "bg": "lightyellow", "attr": ["bold"] },
"line_current_symbol": { "fg": "gray13", "bg": "lightyellow" },
"virtcol_current_gradient": { "fg": "GREEN_Orange_red", "bg": "gray10" },
"col_current": { "fg": "azure4", "bg": "lightyellow" }
"col_current": { "fg": "azure4", "bg": "lightyellow" },
"syntastic_segment": { "fg": "red", "bg": "royalblue5", "attr": ["bold"] }
},
"mode_translations": {
"nc": {
Expand Down Expand Up @@ -65,7 +66,8 @@
"line_percent_gradient": { "fg": "oldlace", "bg": "gray61" },
"line_current": { "fg": "gray13", "bg": "oldlace", "attr": ["bold"] },
"line_current_symbol": { "fg": "gray13", "bg": "oldlace" },
"col_current": { "fg": "azure4", "bg": "oldlace" }
"col_current": { "fg": "azure4", "bg": "oldlace" },
"syntastic_segment": { "fg": "lightyellow", "bg": "darkgreencopper", "attr": ["bold"] }
}
},
"v": {
Expand Down
11 changes: 11 additions & 0 deletions powerline/segments/vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'expand': vim_get_func('expand', rettype=str),
'bufnr': vim_get_func('bufnr', rettype=int),
'line2byte': vim_get_func('line2byte', rettype=int),
'exists': vim_get_func('exists', rettype=int),
}

vim_modes = {
Expand Down Expand Up @@ -441,3 +442,13 @@ def compute_state(key):

Highlight groups used: ``file_vcs_status``.
''')

@window_cached
def syntastic_segment(pl):
'''Return the syntastic statusline flag
'''
if int(vim_funcs['exists']('*SyntasticStatuslineFlag')) > 0:
syntastic_flag_func = vim_get_func('SyntasticStatuslineFlag', rettype=str)
return str(syntastic_flag_func())
else:
return None