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
Conversation
You should request to pull |
I had thought of that after I had already merged. Will keep that in mind in future. I have updated my coded and rebased it to ensure cleaner history. Can you please review it ? Another question, for me all tests except test_cpu_load_percent pass. I am not sure why this test fails however. Travis seems to be passing my code so I suppose this PR is good to go. Should I add tests ? |
What is the comma change for? It is not JSON and having trailing commas has advantage of more simple new items addition, deletion and rearranging. By the way, if your segment output consists of only a |
Add a new segment to theme with name 'syntastic_segment' and it will display the SyntasticStatuslineFlag from syntastic. Refactored Syntastic Segment Checking if function SyntasticStatuslineFlag exists in vim first before getting it's value. Refactored further
Hope this looks good |
Not good to be accepted ? |
I forget to enable syntastic, then I get the error message. I guess you need to check existence before call vim_funcs['syntasticflag']() Error detected while processing function Powerline:
line 3:
E700: Unknown function: SyntasticStatuslineFlag
2013-04-26 17:28:49,490:ERROR:vim:syntastic_segment:Exception while computing segment: 'long' object is not callable
Error detected while processing function Powerline:
line 3:
Traceback (most recent call last):
Error detected while processing function Powerline:
line 3:
File "/Library/Python/2.7/site-packages/Powerline-beta-py2.7.egg/powerline/theme.py", line 89, in get_segments
Error detected while processing function Powerline:
line 3:
contents = segment['contents_func'](pl=self.pl, segment_info=segment_info, **segment['args'])
Error detected while processing function Powerline:
line 3:
File "/Library/Python/2.7/site-packages/Powerline-beta-py2.7.egg/powerline/segments/vim.py", line 91, in ret
Error detected while processing function Powerline:
line 3:
r = func(**kwargs)
Error detected while processing function Powerline:
line 3:
File "/Library/Python/2.7/site-packages/Powerline-beta-py2.7.egg/powerline/segments/vim.py", line 497, in syntastic_segment
Error detected while processing function Powerline:
line 3:
return [{'contents': str(vim_funcs['syntasticflag']())}]
Error detected while processing function Powerline:
line 3:
TypeError: 'long' object is not callable
|
something like this can work @window_cached
def syntastic_segment(pl):
'''Return the syntastic statusline flag
'''
if vim_funcs['syntasticflag']:
return [{'contents': str(vim_funcs['syntasticflag']())}]
else:
return None |
You might have to pull the latest, I made changes that fixes stuff. I don't have a 'syntasticflag' key for vim_funcs. Have a look at the diffs. |
I did not notice you stripped the code to the develop branch. thanks |
Why is this still open ? :( |
Sorry about the lack of feedback! I'll test and merge this PR along with a couple of others when I have time for it, hopefully this week. |
Sure, take it easy :) |
+1 for merging this, a syntactic segment would be great. |
+1 for me too i really need this |
Add a new segment to the theme/vim/default.json with name 'syntastic_segment' and it will display the SyntasticStatuslineFlag from syntastic.