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

Remove and refactor duplicate offset functions #719

Closed
fatih opened this issue Feb 11, 2016 · 2 comments
Closed

Remove and refactor duplicate offset functions #719

fatih opened this issue Feb 11, 2016 · 2 comments

Comments

@fatih
Copy link
Owner

fatih commented Feb 11, 2016

Right now there are several places in vim-go that parses the byte offset of the position under the cursor. The ones I could see are below. And what interesting is that each of them has it's own way of implementing it:

https://github.com/fatih/vim-go/blob/master/autoload/go/complete.vim#L90
https://github.com/fatih/vim-go/blob/master/autoload/go/rename.vim#L67
https://github.com/fatih/vim-go/blob/master/autoload/go/oracle.vim#L65
https://github.com/fatih/vim-go/blob/master/autoload/go/def.vim#L67

Let us create a single function under util.vim with the function signature: go#util#OffSet(), remove all others and use this new function.

@nhooyr
Copy link
Contributor

nhooyr commented Mar 15, 2016

I'll work on this tomorrow.

@nhooyr
Copy link
Contributor

nhooyr commented Mar 16, 2016

The ones in oracle.vim and rename.vim are the exact same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants