Weird cursor problems immediately after launch #8524

Closed
peterflynn opened this Issue Jul 23, 2014 · 14 comments

Comments

Projects
None yet
5 participants
@peterflynn
Member

peterflynn commented Jul 23, 2014

  1. Open QuickOpen.js
  2. Scroll down until line ~68 is at the top of the view
  3. Put cursor at the start of line 75
  4. Restart Brackets
  5. Click somewhere in the middle of the view
  6. Click there again

Result:
4 - top of view is further down -- cursor hidden above the top
5 - cursor goes about 10 lines below where you clicked
6 - cursor goes to correct location, but view scrolls up about 1/2 line for no apparent reason

Clicking now works fine, but if I scroll by dragging the scrollbar thumb, the next two clicks will show the same problem as steps 5 & 6 again.

CC @dangoor @MiguelCastillo -- this just started happening after syncing today

@peterflynn peterflynn added this to the Release 0.42 milestone Jul 23, 2014

@peterflynn

This comment has been minimized.

Show comment
Hide comment
@peterflynn

peterflynn Jul 23, 2014

Member

I'm seeing other weird problems too:

  • Sometimes, the active line highlight is on a separate line from the cursor
  • Sometimes, scrolling with mousewheel moves the text but not the cursor
  • Sometimes, the bottom ~2px of the cursor are missing (it's not as tall as the text) -- most often seen on whatever line the cursor was on at the time Brackets started up

Which of these symptoms you see at startup seems to depend either on the exact pixel alignment of the top of the viewport, or maybe just on timing. They seem to come & go, but something goes wrong almost every time I restart.

Member

peterflynn commented Jul 23, 2014

I'm seeing other weird problems too:

  • Sometimes, the active line highlight is on a separate line from the cursor
  • Sometimes, scrolling with mousewheel moves the text but not the cursor
  • Sometimes, the bottom ~2px of the cursor are missing (it's not as tall as the text) -- most often seen on whatever line the cursor was on at the time Brackets started up

Which of these symptoms you see at startup seems to depend either on the exact pixel alignment of the top of the viewport, or maybe just on timing. They seem to come & go, but something goes wrong almost every time I restart.

@peterflynn

This comment has been minimized.

Show comment
Hide comment
@peterflynn

peterflynn Jul 23, 2014

Member

I think this was caused by #8512. This sounds like exactly the sort of bugs we used to see when the web font didn't finish loading before CM started measuring text. The .dummy-text selector in brackets.less must have the code editor webfont's font-family set on it -- which up until now it was getting via .code-font().

(An important side note from this is that theme extensions have no safe way of using other webfonts as the editor font. I think that's an ok limitation for now, but we should make sure to document it somewhere).

Member

peterflynn commented Jul 23, 2014

I think this was caused by #8512. This sounds like exactly the sort of bugs we used to see when the web font didn't finish loading before CM started measuring text. The .dummy-text selector in brackets.less must have the code editor webfont's font-family set on it -- which up until now it was getting via .code-font().

(An important side note from this is that theme extensions have no safe way of using other webfonts as the editor font. I think that's an ok limitation for now, but we should make sure to document it somewhere).

@peterflynn

This comment has been minimized.

Show comment
Hide comment
@peterflynn

peterflynn Jul 23, 2014

Member

I can confirm that backing out that changes to .code-font() in brackets_theme_default.less fixes this

Member

peterflynn commented Jul 23, 2014

I can confirm that backing out that changes to .code-font() in brackets_theme_default.less fixes this

@MiguelCastillo

This comment has been minimized.

Show comment
Hide comment
@MiguelCastillo

MiguelCastillo Jul 23, 2014

Contributor

@peterflynn I am really thinking that his change isn't really needed.... Is there a quick change we can do to fix it? Otherwise we could just back the changes in the less file. The changes in the ViewCommandHandlers is needed though.

Contributor

MiguelCastillo commented Jul 23, 2014

@peterflynn I am really thinking that his change isn't really needed.... Is there a quick change we can do to fix it? Otherwise we could just back the changes in the less file. The changes in the ViewCommandHandlers is needed though.

@MiguelCastillo

This comment has been minimized.

Show comment
Hide comment
@MiguelCastillo

MiguelCastillo Jul 23, 2014

Contributor

@peterflynn Can you give this a try and let me know how it goes please?

Contributor

MiguelCastillo commented Jul 23, 2014

@peterflynn Can you give this a try and let me know how it goes please?

@MiguelCastillo

This comment has been minimized.

Show comment
Hide comment
Contributor

MiguelCastillo commented Jul 23, 2014

@dangoor

This comment has been minimized.

Show comment
Hide comment
@dangoor

dangoor Jul 23, 2014

Contributor

So far, in my testing #8526 fixes this.

Contributor

dangoor commented Jul 23, 2014

So far, in my testing #8526 fixes this.

@peterflynn

This comment has been minimized.

Show comment
Hide comment
@peterflynn

peterflynn Jul 23, 2014

Member

@dangoor I'm a little skeptical that #8526 fixes this -- in my testing I wasn't clicking anywhere that would show a matching-brace highlight... and none of the conditions that required the .dummy-text workaround have changed afaik (yet we've now removed the workaround).

Also -- since this is load-timing sensitive, it may be harder to reproduce on some machines (SSD?) than others...

Member

peterflynn commented Jul 23, 2014

@dangoor I'm a little skeptical that #8526 fixes this -- in my testing I wasn't clicking anywhere that would show a matching-brace highlight... and none of the conditions that required the .dummy-text workaround have changed afaik (yet we've now removed the workaround).

Also -- since this is load-timing sensitive, it may be harder to reproduce on some machines (SSD?) than others...

@MiguelCastillo

This comment has been minimized.

Show comment
Hide comment
@MiguelCastillo

MiguelCastillo Jul 23, 2014

Contributor

yeah the line height setting isn't really what's breaking this... peter try #8525 if you can. it is a time sensitive thing.

Contributor

MiguelCastillo commented Jul 23, 2014

yeah the line height setting isn't really what's breaking this... peter try #8525 if you can. it is a time sensitive thing.

@redmunds

This comment has been minimized.

Show comment
Hide comment
@redmunds

redmunds Jul 23, 2014

Contributor

I can no longer repro this one in the #8526 branch.

Contributor

redmunds commented Jul 23, 2014

I can no longer repro this one in the #8526 branch.

@dangoor

This comment has been minimized.

Show comment
Hide comment
@dangoor

dangoor Jul 23, 2014

Contributor

@peterflynn Indeed, load timing issues could be different on different machines, so it's quite possible that the font loading change could make a difference that's not visible on my machine.

Contributor

dangoor commented Jul 23, 2014

@peterflynn Indeed, load timing issues could be different on different machines, so it's quite possible that the font loading change could make a difference that's not visible on my machine.

@pthiess

This comment has been minimized.

Show comment
Hide comment
@pthiess

pthiess Jul 24, 2014

Member

@peterflynn to verify fix

Member

pthiess commented Jul 24, 2014

@peterflynn to verify fix

@dangoor

This comment has been minimized.

Show comment
Hide comment
@dangoor

dangoor Jul 28, 2014

Contributor

@peterflynn can you still see any of these problems at startup?

Contributor

dangoor commented Jul 28, 2014

@peterflynn can you still see any of these problems at startup?

@peterflynn

This comment has been minimized.

Show comment
Hide comment
@peterflynn

peterflynn Aug 22, 2014

Member

Oops, meant to close this last cycle -- definitely doesn't happen anymore

Member

peterflynn commented Aug 22, 2014

Oops, meant to close this last cycle -- definitely doesn't happen anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment