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

Add cursor support #48

Merged
merged 8 commits into from
Jul 14, 2015
Merged

Add cursor support #48

merged 8 commits into from
Jul 14, 2015

Conversation

fowles
Copy link
Contributor

@fowles fowles commented Jul 13, 2015

Adds cursor support and java support with conditional version checking for both. I have not regenerated the documentation, because my experiments with vimdoc failed.

Matt Fowles added 2 commits July 12, 2015 22:54
- 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
@googlebot
Copy link
Collaborator

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@fowles
Copy link
Contributor Author

fowles commented Jul 13, 2015

I signed it.

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@malcolmr
Copy link
Member

Generally looks reasonable, though:

  • tests are failing :-)
  • I think adding support for Java formatting with clang-format should be a separate discussion. (For example, I'm not sure how much it'd interfere with Add formatter for Java #43, or with anyone using a local formatter for java files.)

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: single quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@fowles
Copy link
Contributor Author

fowles commented Jul 14, 2015

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.

@fowles
Copy link
Contributor Author

fowles commented Jul 14, 2015

fixed tests. PTAL

@fowles
Copy link
Contributor Author

fowles commented Jul 14, 2015

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:
Copy link
Contributor

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.

@dbarnett
Copy link
Contributor

LGTM.

fowles added a commit that referenced this pull request Jul 14, 2015
@fowles fowles merged commit c426e43 into google:master Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants