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

Detect changes without having to save the file #77

Open
philippotto opened this issue Aug 21, 2014 · 4 comments
Open

Detect changes without having to save the file #77

philippotto opened this issue Aug 21, 2014 · 4 comments

Comments

@philippotto
Copy link

Would it be possible to detect changes without having to save the file? I think GitGutter does this.

I know, that there is an option for autosave, but this is not really convenient. Especially, if you got a file watcher running in your build system which listens to file changes and reacts to them.
Apart from that, autosave only saves the file if I unfocus and refocus the view. Is this behavior intended?

@gornostal
Copy link
Owner

Could you verify GitGutter does that?
If so, I'll take a look at its implementation.

Apart from that, autosave only saves the file if I unfocus and refocus the view. Is this behavior intended?

Yes. The idea was that you may edit a file (that is currently opened in Sublime) in another editor, then when you switch back to Sublime, Modific will update gutter when content updates.
Turns out many users don't like that, because not all want to save a file.
When I was implementing that feature, I couldn't imagine someone wouldn't want to save a file.

@philippotto
Copy link
Author

Yes, GitGutter does this definitely. As far as I can tell it writes the current content of the buffer to a temporary file and diffs it against the current head of the repository.
I think, this is the corresponding code part.

@Narretz
Copy link

Narretz commented Sep 23, 2014

The problem with doing this while editing is that the performance suffers for some people very easily. On Windows, GitGutter always added a small lag.

@philippotto
Copy link
Author

As long as the diffing is asynchronous and debounced, I don't think that this is a problem. In spite of the lag, it probably will feel more immediate than having to save the file manually.

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

3 participants