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

Refactor quickfixsigns#vcsdiff#GetList #65

Merged
merged 2 commits into from Jul 4, 2016

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jul 1, 2016

Previously calling quickfixsigns#vcsdiff#GetList() would not set the
cache.

Also add a quickfixsigns#vcsdiff#ClearCache() API.

Previously calling `quickfixsigns#vcsdiff#GetList()` would not set the
cache.

Also add a `quickfixsigns#vcsdiff#ClearCache()` API.
endif
return b:qfs_vcsdiff_list
endf


function! quickfixsigns#vcsdiff#ClearCache()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to have support for an optional bufnr argument here, but it looks like you cannot easily (without bufdo or b) unset a buffer-local variable for another buffer?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in a5d0802.
I think the caching for the string could be removed?!

This uses a sentinel to allow for "unsetting" other buffer's variables.
@tomtom
Copy link
Owner

tomtom commented Jul 3, 2016

Could you please explain your PR. What are these s:UNSET_* vars. Where are they set?

@blueyed
Copy link
Contributor Author

blueyed commented Jul 3, 2016

The s:UNSET_* vars are sentinel instances to be able to "unlet" lists/strings (by setting them to this value), since apparently Vim does not support unlet for another buffer without side-effects of :bufdo / :b.

This PR fixes an issue where the cache was not used correctly, and provides an API to clear it.
This is useful for statusline plugins etc.

@tomtom
Copy link
Owner

tomtom commented Jul 4, 2016

I still don't see, where this vars are ever set.

@blueyed
Copy link
Contributor Author

blueyed commented Jul 4, 2016

@tomtom
Copy link
Owner

tomtom commented Jul 4, 2016

Ok, now I understand.

@tomtom tomtom merged commit cccd6b8 into tomtom:master Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants