gornostal / modific Goto Github PK
View Code? Open in Web Editor NEWHighlight lines changed since the last commit (supports Git, SVN, Bazaar, Mercurial and TFS) / ST2(3) plugin
Highlight lines changed since the last commit (supports Git, SVN, Bazaar, Mercurial and TFS) / ST2(3) plugin
like Kaleidoscope
On a new mac pro (retina) the region icons are not showing properly. Some appear, and some do not. If I scroll up and down, I can get them to flicker on and off. Changing the icon from dot to circle (for example) seems to change exactly where in the scrolling the icons flicker out, but doesn't otherwise help.
Turning on the debug option shows that it is correctly calculating the line on which to display the icon.
This was working pretty good on my previous mac (both run mountain lion). It's probably something to do with the retina, so it might be hard to replicate. Let me know if there's anything I can help with (could probably provide a video, for example).
Sublime build 2200
$ git diff |wc
2458 10097 108818
Files with lots of changes (so far that's my only guess about differentiating proper behavior from problems) get display issues like invisible cursor, invisible tabs row. Sometimes tabs row is back if i move mouse over it. Current line highlight still works fine. All editor features work normally.
Editor restart, reinstall (using package control) does not help. Uninstall helps of course, but when Modific worked it is very helpful.
Please, vote for this issue on Sublime's bug tracker.
I've installed Modific to my sublime text but could not show diff on some files.
So I turned debug option on, console shows the error below.
Exception in thread Thread-243:
Traceback (most recent call last):
File ".\threading.py", line 532, in __bootstrap_inner
File ".\Modific.py", line 121, in run
File ".\Modific.py", line 71, in _make_text_safeish
File ".\encodings\cp1252.py", line 15, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 574: character maps to <undefined>
I checked out this error happened at source files contained not ascii chars.
And I resolved this error changing plugins source code below
def _make_text_safeish(text, fallback_encoding, method='decode'):
# The unicode decode here is because sublime converts to unicode inside
# insert in such a way that unknown characters will cause errors, which is
# distinctly non-ideal... and there's no way to tell what's coming out of
# git in output. So...
try:
unitext = getattr(text, method)('utf-8')
except (UnicodeEncodeError, UnicodeDecodeError):
#unitext = getattr(text, method)(fallback_encoding)
unitext = str(text)
except AttributeError:
# strongly implies we're already unicode, but just in case let's cast
# to string
unitext = str(text)
return unitext
but I'm not good at python so I don't know this change will cause other side effect.
plz check out this issue.
I don't know if there's a sublimetext API for that, but it would be great to have uncommitted files marked, either next to tab title or filename in the sidebar (or both.)
I'm using the shipped Diff package, more precisely the diff_changes
command, to preview my unsaved changes (via hotkey).
It's in Packages\Diff\diff.py
(line 40) if you are interested.
The main difference is that it uses an output window which does not require to switch the view (and switch back if you need to edit it).
Hello,
I'm a Bazaar user. I installed Modific via Package Control.
For me, modified lines aren't highlighted and icons are not displayed. For a file from a project managed with Bazaar, only "Modific: Show diff" is present in the command palette, however, selecting it only closes the palette and does nothing else. "View uncommitted files in a quick panel" works when pressing its shortcut. Other commands, like preview, are missing from the command palette and their shortcuts have no effect.
I already tried the following: Restarting Sublime Text, changing the colour scheme and restarting, uninstalling and reinstalling Modific via Package Control, changing Modific user settings so bzr is on top of the vcs prority. After seeing bug #25, I set "svn_use_internal_diff" to false, just in case. Nothing of that solved my problem.
This is my configuration:
Sublime Text 2, build 2220, 64bit
Bazaar 2.5.1, the path to its binaries is included in PATH
Windows 8 Release Preview, Build 8400, 64bit
Thanks in advance.
Just installed Modific on latest stable ST2 build (2181) through Package Control/Mac OSX 10.7, having hg
available in my PATH
:
$ which hg
/opt/local/bin/hg
$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/narwhal/bin:/opt/local/lib/postgresql90/bin:/Users/nperriault/bin:/usr/local/bin:/usr/local/share/php/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin/node:/usr/local/bin/npm:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
I get this stack in ST's console:
Traceback (most recent call last):
File "./sublime_plugin.py", line 350, in run_
File "./Modific.py", line 199, in run
File "./Modific.py", line 214, in hg_diff_command
File "./Modific.py", line 205, in get_user_command
TypeError: 'NoneType' object is not iterable
Git has a --word-diff option which is really handy for small changes in long lines. The output format is different.
I'm using ST3 and get this working. I'm getting the following message in the console:
svn: invalid option: --internal-diff
Type 'svn help' for usage.
Any ideas?
Hello,
I have a file named @foo.bar versioned using SVN and when I edit the file the diff markers are not shown after saving the file and when I do diff (Ctrl+Alt+D) it says
svn: E125001: '@foo.bar' is just a peg revision. Maybe try '@foo.bar@' instead?
Maybe related to issue #10? FWIW, using version 2012.08.12.02.43.03.
Thanks for looking into this!
Ctrl+Shift+PageUp / PageDown are already used by the MoveTab plugin
https://github.com/SublimeText/MoveTab
I have installed a Modific plugin (btw: thanks - it's a great tool!) and I have noticed an error in the console:
svn: invalid option: --internal-diff
I have switched svn_use_internal_diff to false and It solved the problem.
So if it can cause a problem shouldn't it be set to false by default? If for a some reason it's better to use internal diff maybe it would be better to add some info about this issue to the documentation?
BTW, what does it mean to use internal diff? I assume that there are 2 possibilities: internal and external(?) diff. But what does it mean?
This is a great product, however sometimes we are required to open semi large files (1MB+), this plugin seems to cause sublime to slow down. What would be great is a setting to limit checking the source control by file size. For a work around now we have change the following Under DiffCommand -> run
def run(self, edit):
vcs = get_vcs(self.get_working_dir())
filename = os.path.basename(self.view.file_name())
get_command = getattr(self, '{0}_diff_command'.format(vcs['name']), None)
if get_command:
self.run_command(get_command(filename), self.diff_done)
def run(self, edit):
vcs = get_vcs(self.get_working_dir())
filename = os.path.basename(self.view.file_name())
if self.view.size() > 200000:
return
get_command = getattr(self, '{0}_diff_command'.format(vcs['name']), None)
if get_command:
self.run_command(get_command(filename), self.diff_done)
I'm using Git with Modific to check on changes within my files. Due to special process we are using I use different command-line parameters than ones provided by default.
I found out that the only way to modify them is to modify Modific.py itself.
Another workaround is to write special script file to parse params you passed and call git with the params I need.
Both seem pretty uncool.
Could you add an ability to configure VCS more precisely?
"vcs": {
'git': [
'git', 'diff', '--no-color', '--no-ext-diff', '--'
]
}
I know that this would cause problems with SVN as it dynamically adds ['--revision', 'HEAD'] and I do not have a ready available solution for this.
This doesn't work since strFieldID is the same for both sections (only the last will appear) , but I feel I should be able to use the same strFieldID value as long as they are in different sections (they are logically different since they are children of different sections).
Just my 2c :)
<?php
$this->setRootMenuPage( 'Config');
$this->addSubMenuPage(
'Production',
'prod',
'tools'
);
$this->addSettingSections(
array(
'strSectionID' => 'conf_prod',
'strPageSlug' => 'prod',
'strTitle' => 'Production'
)
);
$this->addSettingFields(
array(
'strFieldID' => 'version',
'strSectionID' => 'conf_prod',
'strTitle' => 'Versionsnumber',
'strType' => 'text'
)
);
$this->addSubMenuPage(
'Beta',
'beta',
'tools'
);
$this->addSettingSections(
array(
'strSectionID' => 'conf_beta',
'strPageSlug' => 'beta',
'strTitle' => 'Beta'
)
);
$this->addSettingFields(
array(
'strFieldID' => 'version',
'strSectionID' => 'conf_beta',
'strTitle' => 'Versionsnumber',
'strType' => 'text'
)
);
?>
I'm also using a linter and sometimes the order of which icons are displayed gets confusing (modified lines are over error icons). It'll be nice to be able to toggle modific icons.
I am loving Modific -- it has been a huge part of my decision to switch from netbeans.
I'm wondering, however, if there's any way you could add an option for icons that are more in the netbeans style. Namely, if you modify multiple lines in sequence, you would essentially see a blue "bar" on the left side, where the icon for each of the modified lines touch. The same would go for inserted lines. Changing the "region_icon" setting to be "cross" seems to get close to this effect, but I can't seem to customize the colors when I use this option.
I know this is picky, but it would be hugely helpful to me, since my brain is trained this way already!
Thanks!
There appears to be a keybinding for F2 which is interfering with a keybinding from another plugin. When I remove modific F2 is correctly bound to the other function.
Normally in ST2, if I edit a file and don't save it, the 'close' icon for that tab changes to a filled circle, like the image below:
If I undo all my unsaved changes, then ST2 changes the circle back to the 'close' icon.
Now when I'm using Modific, when I edit a file and don't save it, the 'close' icon changes to the circle as normal. When I switch over to another tab, and then back to the original one, Modific highlights the lines where I've made changes (I believe this is the normal behaviour) and since I haven't saved my file, ST2 still shows the circle in the tab.
Now here's the funny thing: if I switch over to another tab, and then back to the original one, the circle icon changes to the 'close' icon, even though I haven't saved my file. Moreover, when I undo all the unsaved changes, the 'close' icon changes to the circle even though there are no changes to be saved in the file.
I don't have autosave enabled in ST2, and I'm using Git as the VCS.
i have to reinstall and reboot sublime to get it working again
n thread Thread-33:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "Modific in /Users/carter/Library/Application Support/Sublime Text 3/Installed Packages/Modific.sublime-package", line 115, in run
File "X/subprocess.py", line 906, in communicate
File "X/subprocess.py", line 1531, in _communicate
File "X/subprocess.py", line 831, in _translate_newlines
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 199: ordinal not in range(128)
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 303, in on_activated
callback.on_activated(v)
File "/Users/carter/Library/Application Support/Sublime Text 3/Packages/SublimeHaskell/autocomplete.py", line 1267, in on_activated
self.set_cabal_status(view)
File "/Users/carter/Library/Application Support/Sublime Text 3/Packages/SublimeHaskell/autocomplete.py", line 1241, in set_cabal_status
(cabal_dir, project_name) = get_cabal_project_dir_and_name_of_file(filename)
File "/Users/carter/Library/Application Support/Sublime Text 3/Packages/SublimeHaskell/sublime_haskell_common.py", line 208, in get_cabal_project_dir_and_name_of_file
cabal_file_path = find_file_in_parent_dir(directory_of_file, '*.cabal')
File "/Users/carter/Library/Application Support/Sublime Text 3/Packages/SublimeHaskell/sublime_haskell_common.py", line 238, in find_file_in_parent_dir
for name in os.listdir(current_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/Users/carter/Library/Application Support/Sublime Text 3/Packages/Modific'
Exception in thread Thread-34:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "Modific in /Users/carter/Library/Application Support/Sublime Text 3/Installed Packages/Modific.sublime-package", line 115, in run
File "X/subprocess.py", line 906, in communicate
File "X/subprocess.py", line 1531, in _communicate
File "X/subprocess.py", line 831, in _translate_newlines
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 199: ordinal not in range(128)
Writing file /Users/carter/Dropbox/projects/active/WellPosedWork/code/hOpenBLAS/readme.md with encoding UTF-8 (atomic)
Exception in thread Thread-36:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "Modific in /Users/carter/Library/Application Support/Sublime Text 3/Installed Packages/Modific.sublime-package", line 115, in run
File "X/subprocess.py", line 906, in communicate
File "X/subprocess.py", line 1531, in _communicate
File "X/subprocess.py", line 831, in _translate_newlines
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 199: ordinal not in range(128)
Writing file /Users/carter/Dropbox/projects/active/WellPosedWork/code/hOpenBLAS/src/Numerical/OpenBLAS/BLAS/FFI.hs with encoding UTF-8 (atomic)
Writing file /Users/carter/Dropbox/projects/active/WellPosedWork/code/hOpenBLAS/src/Numerical/OpenBLAS/BLAS/FFI.hs with encoding UTF-8 (atomic)
Since this plugin works based on your theme, you should probably add a example theme or provide the minimum requirement for it to work.
For example, on my theme I had to add this:
<dict>
<key>name</key>
<string>diff.header</string>
<key>scope</key>
<string>meta.diff, meta.diff.header</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#75715E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#D4242E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#8FA532</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#CCA300</string>
</dict>
</dict>
OS X 10.9
SublimeText 3
When using Modific
Exception in thread Thread-16:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "Modific in /Users/fbd/Library/Application Support/Sublime Text 3/Installed Packages/Modific.sublime-package", line 115, in run
File "X/subprocess.py", line 906, in communicate
File "X/subprocess.py", line 1531, in _communicate
File "X/subprocess.py", line 831, in _translate_newlines
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 215: ordinal not in range(128)
While modific is enabled, sublime text 3 will not display the external changes when modific is turned on. I have the config option of auto save turned off but it still seems to attempt to save and overwrite the external changes. It will however show that there are changes.
Hi
in console after starting Sublime or reloading plugins i can see:
Traceback (most recent call last):
File "./Modific.py", line 398, in diff_done
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 126: ordinal not in range(128)
I have a couple of ST2 plugins which execute on "save action". As a result, Modific fails to execute randomly. When I disable other "save action" plugins, Modific works fine. I've solved this problem by adding 50ms execution delay for Modific in my local files.
I request officially adding a small delay in Modific code for delaying executing svn commands by a small mount, say 10 or 50 ms.
Feature request: Create some shortcut to automatically fold unchanged parts of document.
Usage: It can be useful when you are working with large documents and you are editing for example one function at the start of document and one in the middle. Instead of going through the document and looking for changes it would be nice to have some shortcut to automatically fold/unfold the unmodified functions if you know what I mean.
Yes of couse, you can do that manually by "find next change" (or fold it by yourself), but it could be real time saver. Sometimes it's just necessary to see both parts at once.
I happen to work on a svn working copy with lots of new files added (A) and most of them can't show the diff in ST2, console view shows me :
Traceback (most recent call last):
File ".\Modific.py", line 391, in diff_done
File ".\Modific.py", line 314, in get_lines_to_hl
File ".\Modific.py", line 293, in get_chunks
IndexError: string index out of range
I also seems that it may been due to some property changes in the diff, the few files that work and show the diff have no property change, whereas the ones I see failing have:
Property changes on: src/xxxxx.cpp
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Maybe you should add a link to the forum discussion somewhere on the readme!
http://www.sublimetext.com/forum/viewtopic.php?f=5&t=7468
Kudos!
Getting this error:
"'git' binary could not be found in PATH
Consider using the vcs_command to specify PATH"
Currently Git package supports to configure "git_command" in settings, maybe Modific could do the same?
Hi.
Working with SVN, it won't mark the changed files nor show the diff.
It outputs the error "no --internal-diff" command - maybe i'm using an older svn.
in Class - DiffCommand, def svn_diff_command:
if settings.get('svn_use_internal_diff', True):
params = [self.get_user_command('svn') or 'svn', 'diff', file_name]
Thanks.
Please add support for Perforce
Hi.
It will be very useful if we could jump to the next changed line with a dedicated keyboard shortcut.
Thanks.
when a file is under a directory which has a name with "@" character, the plugin stops working: it doesn't show the change markers, diff operation says that the file is not under svn repository.
"@" character in svn is used for revisions - thus - it's a known issue.
suggested by user https://github.com/eladyarkoni:
the "run" method in class "DiffCommand", should be:
def run(self, edit):
vcs = get_vcs(self.get_working_dir())
filename = os.path.basename(self.view.file_name())
get_command = getattr(self, '{0}_diff_command'.format(vcs['name']),None)
if get_command: self.run_command(get_command(filename), self.diff_done)
By my testing and daily work, this solution plays nicely with svn and doesn't break mercurial.
Sorry this is not an issue, but just i would like to know if changed files names on sidebar can be colored ?
Thanks
An SVN console window keeps popping up, opening and closing many times per second, making working with Sublime impossible. Seems only to happen on files that are under version control, and disabling Modific solves the issue.
Screenshot: http://imgur.com/2f7gIbW
The half transparent windows you see in the screenshot are the problematic console windows, they don't contain anything but black background, and the titlebar points to "C:\Program Files\TortoiseSVN\bin\svn.exe"
Modific version: 2013.07.24.02.57.56
TortoiseSVN version: TortoiseSVN 1.8.0, Build 24401 - 64 Bit , 2013/06/17 18:15:59
other SVN related packages installed in Sublime: "Tortoise" & "TortoiseSVN"
I was wondering if it is possible to change dot colors? In some color schemes, like LAZY, the dots appear in black for changes and new lines too.
{ "keys": ["ctrl+super+d"], "command": "show_diff" },
There's a conflict with the System "Define"
I see (from status line) it is trying to invoke
git diff --no-color --no-ext-diff -- Note.md
which is not version controlled.
Then this will show up in the log (Ctrl+</kbd>)
usage: git diff [--no-index] `
Can this be hidden?
Modific fails under ST3 beta (3010) with the following:
reloading plugin Modific.Modific
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 70, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 854, in _load_module
File "<frozen importlib._bootstrap>", line 981, in get_code
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/Users/<user>/Library/Application Support/Sublime Text 3/Packages/Modific/Modific.py", line 113
except subprocess.CalledProcessError, e:
Took me quite a while to realize which of the sublime2 packages triggered my watches every time i focused on a file.
After i discovered it was modific i saw the relevant setting which i immediately set on my user settings file Modific.sublime-settings
(I even tried the main Preferences.sublime-settings
file).
However the auto-saving persisted, although i think it was on focus-lost this time.
The only solution for me was to put the Modific
package in the ignored_packages
setting, in-effect switching the package off.
Hi,
I have sublime text 2.0.1 Build 2217 installed. The only plugin enabled is Modific. Sometimes when I am editing files, the CPU usage of ST2 goes up to 100% for half a minute or so before coming down and meanwhile I cannot do anything. I think its Modific which is the culprit since if I disable it, the problem vanishes. The file sizes are not huge (<1M). The only thing I could think of was that maybe there are delays in connecting with the svn server. Anyone else having similar problems?
P.S. I really like Modific, for me its absolutely a must with ST2.
Hi!
When last (empty) line of the file is removed and some other lines are added, Modific does not highlight them in the editor.
Running the diff manually svn diff --internal-diff service.yaml
gives the following diff:
[...]
@@ -69,4 +74,14 @@
columns: [owner]
unique: false
access_method: btree
-
+foreign_keys:
+ fk_key_number:
+ columns: key_number
+ references:
+ table: number_pool
+ columns: id_number
+ fk_ikey_endpoint_type:
+ columns: ikey_endpoint_type
+ references:
+ table: classificator
+ columns: key_integer
(notice the -
, the removed line)
When I keep the line there so that the diff looks like
@@ -70,3 +75,14 @@
unique: false
access_method: btree
+foreign_keys:
+ fk_key_number:
+ columns: key_number
+ references:
+ table: number_pool
+ columns: id_number
+ fk_ikey_endpoint_type:
+ columns: ikey_endpoint_type
+ references:
+ table: classificator
+ columns: key_integer
I see nice dots next to the added lines.
(sorry for not providing a patch)
Please add possibility which could replace options for SVN. In ubuntu 12.04 there is not such option "--internal-diff" and plugin not works.
Mac OS
Git
Can't run Ctlr+Super+U, when all files are closed.
P.S. Thanks for cool plugin.
HI,
As the title says, I work on unix EOL style files, and whenever I use the revert block feature of modific, the lines are appended with a CR byte.
This also breaks svn diff display, as svn is probably warning about abnormal specific EOL inside my file so every modific markup vanishes.
As soon as I delete the CR bytes (I can do it from ST3 :) ) the diff works again and shows the marks in the gutter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.