-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add cursor support #48
Conversation
- add suport for version checking - if version high enough, add java support - if version high enough, add cursor control
- invalidate cache on executable change - bump required maktaba version - add tests
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it. |
CLAs look good, thanks! |
Generally looks reasonable, though:
|
let l:supports_cursor = s:ClangFormatHasAtLeastVersion([3, 4]) | ||
if l:supports_cursor | ||
" line2byte counts bytes from 1, and col counts from 1, so -2 | ||
let l:cursor_pos = line2byte(line(".")) + col(".") - 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: single quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Not sure what you mean by "interfere with #43". I think this implements it. Custom formatters will take precedence, since we install the built-ins as "defaults" that come last in the lookup order. |
fixed tests. PTAL |
pulled out the java stuff so we can handle it separately |
@@ -163,7 +191,7 @@ function! codefmt#GetClangFormatFormatter() abort | |||
function l:formatter.AppliesToBuffer() abort | |||
return &filetype is# 'c' || &filetype is# 'cpp' || | |||
\ &filetype is# 'proto' || &filetype is# 'javascript' | |||
endfunction | |||
endfunction: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've got a stowaway colon here.
LGTM. |
Adds cursor support and java support with conditional version checking for both. I have not regenerated the documentation, because my experiments with vimdoc failed.