Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Invisible cursor, tabs row #9

Closed
temoto opened this Issue · 41 comments
@temoto

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.

@gornostal
Owner

Oh, I understand what are you talking about.
Sometimes I experience similar issues too. And I don't think problem is in large diffs (tried to make diff of 3000 lines - still works fine).

I'm pretty sure that drawing icons in the gutter cause those issues.

Unfortunately, I can't reproduce issues when I want to. If I could I would probably make a bug report for ST2.

Do you have those issues constantly with files where a lot of modifications?

What OS do you use?

@temoto

On a second try i can't reproduce issue every time either.

OS: Linux 3.4.2-2-ARCH x86_64.

My colleague experience same issues on MacOSX Lion. Restarting Sublime helps him more often than not.

@gornostal
Owner

I will ask on forum. Maybe there someone could help with this.

@peterturza

Same issue here. I cannot reproduce it always.
OS: 3.2.0-26-generic-pae #41-Ubuntu Kubuntu 12.04
Sublime Text build 2200

@temoto

Reproduces when i move sublime to another workspace in xmonad.

@hdennison

Same issue here, 2.0.1 on Win7 and build 2218 on OS X.
I've got problems with disappearing rulers, and other UI gotchas (tabs, panels..)

@gornostal
Owner

Try to disable autosave in your config file for this plugin.
Seems like it helped me.
Let me know if it will help for anyone.

@mkawczynski

Same here. Ubuntu 12.04. Both stable and nightly release.
I can reproduce each time with specific files. I suppose that this files have longer lines then my other files.

@gornostal
Owner

@mkawczynski, could you please give me that file (if that is not something secret, of course)?
Did you try set autosave to false?

@mkawczynski

Actually I cannot reproduce problem - maybe autosave option changed to false has helped me (I disabled this plugin about month ago and few day ago enabled again). Will wait and if problem occurs - I'll send a problematic file.

@gornostal
Owner

@mkawczynski OK. Thanks.

@temoto

With autosave do you mean save_on_focus_lost? Anyway, i tried adding both to false to my config and the issue is still there. Saving config makes tabs reappear for one time though.

@gornostal
Owner

With autosave do you mean save_on_focus_lost?

No, I meant autosave. Where did you get save_on_focus_lost option? It's certainly not from this plugin.

Well, if you're saying issue did not go away, than I still have no idea how to get rid of it.

@temoto

Save-on-lost-focus is built in, i believe. There is autosave feature in modific? I was adding it to the global user config.

@gornostal
Owner

There is autosave feature in modific?

Yes. Try to disable that.

@temoto

Now i added it to modific user config, does not help.

Even worse, now old fix (stick Sublime to one particular workspace) does not help either (worked for weeks).

@gornostal
Owner

Strange things going on.
Disabling autosave helped me. This issue has not been appeared for two weeks.

@temoto

I must add that problem returned before i set "autosave": false in modific user config, but after first tries with global user config.

@mkawczynski

@gornostal - I reproduced problem and have file which make wrong behaviour of sublime. How could I send these files to You? Could You contact with me by email?

@gornostal
Owner

@mkawczynski sent an email.

@gornostal
Owner

@mkawczynski tried to reproduce this issue. Have no luck :(
Plugin works fine. I've even tried to enable autosave (which is a default state).

Could you please show me an output of these commands (from the command window inside Sublime)?

>>> sublime.version()
u'2216'
>>> import sys
>>> sys.version
'2.6.6 (r266:84292, Jun 16 2011, 22:35:51) \n[GCC 4.4.5]'

So I guess a large diff (or file) isn't just enough to break UI of the Sublime.

@mkawczynski

I have same output:

>>> sublime.version()
u'2216'
>>> import sys
>>> sys.version
'2.6.6 (r266:84292, Jun 16 2011, 22:35:51) \n[GCC 4.4.5]'
@spaze

Just FWIW, I had similar issues, vanishing tabs and modification icons (see #19) and seems that after changing the Sublime Text theme (to Soda Dark in my case) I'm not facing this issue, hopefully. Let's see for how long.

@ignacysokolowski

Neither setting "autosave": false nor changing theme worked for me. Today I changed the theme to Soda Dark and the issue came back after a week.

@mkawczynski

I made simple workaround for this bug (which I'm 95% sure is inside Sublime.) Since 2 weeks never seen issue.

Change is made in modific plugin.

If anyone is interested, please change two functions in modific.py:

    def hl_lines(self, lines, hl_key,miliseconds):
        if (not len(lines)):
            self.view.erase_regions(hl_key)
            return
        icon = settings.get('region_icon') or 'dot'
        points = [self.view.text_point(l - 1, 0) for l in lines]
        regions = [sublime.Region(p, p) for p in points]
        if settings.get('add_delay_between_add_regions', False):
            self.view.add_regions(hl_key, regions, "markup.%s.diff" % hl_key, icon)
        else:
            sublime.set_timeout(functools.partial(self.view.add_regions, hl_key, regions, "markup.%s.diff" % hl_key, icon), miliseconds)

    def diff_done(self, diff):
        if diff and '@@' not in diff:
            # probably this is an error message
            print diff

        diff_parser = DiffParser(diff)
        (inserted, changed, deleted) = diff_parser.get_lines_to_hl()

        if settings.get('debug'):
            print inserted, changed, deleted
        self.hl_lines(inserted, 'inserted',200)
        self.hl_lines(deleted, 'deleted',500)
        self.hl_lines(changed, 'changed',800)

You need also turn workaround on by adding parameter 'add_delay_between_add_regions' and set it to True.

Workaround sets different regions with small delay (in my opinion condition race happens when there are 2 or more kinds of line changes)

Remember to turn off plugin updating for Modific, cause in next release of plugin You'll loose workaround.

@gornostal
Owner

@mkawczynski thanks for this workaround. I hope it will help someone.

You can put in the comment a link to your branch with this workaround, so people could simply pull it from your repository.

@owend

That patch fixes the problem for me.

As others have mentioned, I also noticed that if I change color scheme, then it works reliably in the new color scheme. The first color scheme that loads is always messed up. So if I change to a color scheme that I don't like, quit sublime, restart sublime and then load a color scheme that I do like, it seems to work from then. That's weird, for sure.

@temoto

Seems to work for me too. Will give it some more time to see if problem returns.

@temoto

Unfortunately, patch does not fix it, problem is back after restart. Pinning Sublime to one workspace does not help this time.

I also confirm that it is somehow related to color themes. Solorized and few other always reproduces issue. Monokai and few other always work without problem.

Thank you, @owend the change-theme-restart-change-back trick works.

@gornostal
Owner

:point_right: Guys, I've reported about this issue on Sublime's bug tracker.
:point_right: Please, vote for it. Hope the developer of Sublime will see it and fix it.

Thanks.

@JeanMertz

I've had the same problems. Will try the patch.

@jakerella

Same issue, voted for the ST2 bug linked above.

I seem to be able to reliably reproduce the issue though. Below are some situations and what happens, note that in each case I had two files/tabs open, one of the files caused the issue, the other did not - that is, when I was focused on one file things were fine, and when focused on the other file things were broken. Both files contain uncommitted changes and were similar in nature.

1) Start ST2 in non-working scheme (Monokai) then switch to working scheme (Blackboard) and everything is fine in second scheme (but not first one when I switch back).

2) Start ST2 in working scheme (Blackboard) and then switch to non-working scheme (Monokai) and BOTH schemes work fine (even after switching back and forth).

3) Copy "diff.*" entries from non-working scheme (Monokai) to working scheme (Blackboard); afterward neither scheme works properly, however using a third scheme (Twilight) and I can reproduce situations (1) and (2).

My guess is that there is some specific value in the color scheme that is doing this. When I add the diff.* values to Blackboard the gutter dots have appropriate colors (otherwise the dots are there, but all the same color). Note that when I add the same diff.* elements to Twilight that color scheme does NOT break, but the gutter dots do not change color.

The entries I copied:

<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>#F92672</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>#A6E22E</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>#E6DB74</string>
    </dict>
</dict>

Let me know what other info I can provide. I will also post this on the ST2 bug tracker.

>>> sublime.version()
u'2217'
>>> import sys
>>> sys.version
'2.6.6 (r266:84292, Jun 16 2011, 22:35:51) \n[GCC 4.4.5]'
@tednaleid tednaleid referenced this issue in tednaleid/sublime-EasyMotion
Closed

cursor appearance not updated after jump (vintage mode) #12

@gornostal
Owner

@jakerella okay, so it appears to be an issues with colors and themes.
Anyway, we can only wait until Sublime's developer will notice this issue and fix it.

@Rowno

Maybe you should have a look at how GitGutter renders the icons? I haven't had any glitches while using it yet.

@gornostal
Owner

I saw it. I guess it draws images on the gutter instead of using colors from user's theme.
I should probably do the same to avoid such bugs.

Thanks for advice. I will try to find time for that.

@Rowno

Well it says in the README:

The colors come from your color scheme .tmTheme file.

But it would still be worth checking out how GitGutter works, maybe it's doing something differently. :wink:

@vshjxyz

same issue here, however the workaround give by @mkawczynski is working pretty well

@gornostal gornostal referenced this issue from a commit
@gornostal add custom icons
looks like it fixes issue #9
a449113
@gornostal
Owner

Good news guys!
I added custom icons, and looks like issue doesn't appear anymore :)
Can you confirm that please?

@ajimix

Seems that @gornostal fix of new custom icons is currently working. I would say to wait and keep trying for a few more days before doing the change. From my side, +8h of work with some files with more than 500 added/deleted/modified lines and nothing strange happened :) :+1:

@vshjxyz

Yep it seems to work with the latest update! :+1:

@gornostal
Owner

I guess it's time to close this issue.

@gornostal gornostal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.