-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update the buffers after creation from original file? #30
Comments
It's a difficult problem to solve without significant drawbacks. The way that the proxy buffers and the original keep in sync is that the proxy buffers keep a range of lines from the original that they're affecting. Once you update the proxy buffers, that range gets entirely replaced, and the signs and everything can be updated. But the other way around is not possible, because there's no way to tell if lines have been added or removed. Say you had this content in the original buffer: def foo
puts "bar"
end Now, if you proxied this buffer and then made this change in the original: def foo
puts "bar"
puts "baz"
end How would the proxy buffer look now? Well, it'd have to be updated like so: def foo
puts "bar"
puts "baz" This is probably not what you'd expect, especially if you're using it to diff two pieces of similar code. But there's no way for the proxy to know "the start and/or end line has changed", because the change is logical. There might be a way to guess, if Vim were throwing an event like "line has been added within this range" (although even then it'd be difficult to say what would happen if you add a file after the end of the range). It might be possible to create a command that manually replaces a particular range. Say, you make some change in the original buffer, and then you select the new area it should be covering, do a Does that make sense? Am I explaining well enough the problem, and what do you think of a potential |
I don't think I need this feature, but I noticed that Vim actually updates signs on changes to the buffer just like it does with the marks (try adding/removing lines and see signs keeping their positions). There is also |
Oh, that's very interesting. I hadn't realized that Vim actually moves the signs around. Thank you, @xaizek, I'll try to build something using this info. |
I know that this might be outside the scope of the plugin but I figured since it has so many nice things (like sign markers and everything) it would be cool if it could detect and sync the changes made in the source buffer.
The text was updated successfully, but these errors were encountered: