-
Notifications
You must be signed in to change notification settings - Fork 223
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
binary files #189
Comments
That's weird. The encoding/decoding name for hexadecimal in python is just hex, so I wonder why the view is returning hexadecimal as it's encoding. If you tried to decode with the string "hex" instead it would work. I wonder if this is something that was fixed in ST3.. will test when I get a chance. |
ST3 still returns "Hexadecimal" when in a hexadecimal view. |
@KevinLi Can't see your pull request :) |
Me neither! I have no idea what's going on! |
I think it still exists looking at the code. There is no rewriting of encoding from 'Hexadecimal' to 'hex'. |
Probably, you deleted the fork from your own account, which the PR was based on. So the PR went away? |
As SublimeText's hexadecimal encoded representation of a binary file wouldn't be saved to disk in a form git diff could handle it and there is no reason to show markers for those files, the whole git_gutter command is disabled if a view returns 'Hexadecimal' encoding. Views marked as scratch are most likely not intended to represent normal files so handle them like widgets.
As SublimeText's hexadecimal encoded representation of a binary file wouldn't be saved to disk in a form git diff could handle it and there is no reason to show markers for those files, the whole git_gutter command is disabled if a view returns 'Hexadecimal' encoding. Views marked as scratch are most likely not intended to represent normal files so handle them like widgets.
…ions All these need to be re-added as pull requests and have a proper review. Revert "Add some common linting rules and fixed some smaller code formating issues." This reverts commit 4e15274. Revert "Fix Issue #189: Disable GitGutter for binary files and scratch views." This reverts commit ec007a6. Revert "Fix Issue #264 "Broken Menu File"" This reverts commit fdbbb63. Revert "Add 'Compare against file commit' and enable filtering by commit id (Issue #281)" This reverts commit c6c8e90. Revert "Make the status message somewhat smarter." This reverts commit e3642b3. Revert "Reduce module dependencies between git_gutter.py and its submodules." This reverts commit 0aa5d45. Revert "Show the correct branch or tag name in the 'compare against' status message." This reverts commit 967f807. Revert "Decode git output directly after reading from standard output." This reverts commit f6967dd. Revert "Securing git execution." This reverts commit 0fd472d.
There are several situations running GitGutter might be useless or disturbing, so it should keep disabled. 1. BINARY FILES As SublimeText's hexadecimal encoded representation of a binary file wouldn't be saved to disk in a form git diff could handle it and there is no reason to show markers for those files, the whole git_gutter command is disabled if a view returns 'Hexadecimal' encoding. 2. SCRATCH / READONLY / WIDGET VIEWS Views marked as scratch or readonly are most likely not intended to represent normal files so handle them like widgets and disable GitGutter. 3. UNATTACHED VIEWS SublimeLinter disables linting for views with no valid window() attached and states it as possible way to detect widgets for sure in some builts of SublimeText. 4. SublimeREPL The sublimeREPL plugin sets a view setting repl to mark a view as output. SublimeLinter uses this setting to disable itself, so GitGutter should do so, too. Where to check the view? The git_handler is now created for all GitGutterCommand objects to be used in its is_enabled method. This doesn't hurt as temporary files are created on demand by git_handler.
if you try to open a binary file gitgutter raises an exception
sublime 2 on linux here.
The text was updated successfully, but these errors were encountered: