Skip to content

Editor is not scrolled to found text on tab that was not previously opened #5416

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

Open
per1234 opened this issue Sep 25, 2016 · 6 comments
Open
Assignees
Labels
editor-refactor Related to the refactoring of the Arduino IDE's editor component Type: Bug

Comments

@per1234
Copy link
Collaborator

per1234 commented Sep 25, 2016

Using Arduino IDE 1.6.13 Hourly Build 2016/09/23 03:33 with Windows 7 64 bit

  • Create a sketch with 2 tabs
  • Add text to be found in the second tab on a line that will require the editor window to be scrolled down to show the text.
  • Save and close the sketch
  • Open the sketch
  • Edit > Find > Find: > enter text to be found > Search all Sketch Tabs(check) > Find - the text is found in the second tab but the editor window is not scrolled down to show the found text.

The reason that the sketch must be closed and then reopened is the issue doesn't occur once the second tab has been opened, as in #5380.

This issue doesn't occur in Arduino IDE 1.6.12(EDIT: I meant 1.6.11) or previous.

@facchinm facchinm added the editor-refactor Related to the refactoring of the Arduino IDE's editor component label Sep 26, 2016
@matthijskooijman
Copy link
Collaborator

This issue doesn't occur in Arduino IDE 1.6.12 or previous.

@per1234, are you sure you mean 1.6.12 here? Or 1.6.11? Since the changes in git master / hourly build since 1.6.12 are just a handful, none of which seem related to this issue.

@matthijskooijman
Copy link
Collaborator

I dug into this a bit more, it seems that the problem is that setting the caret position normally scrolls towards it (due to this line called from here. However, this only happens when modelToView() (called a few lines before) returns non-null. The implementation for modelToView that ends up being used only does this when getVisibleEditorRect() returns non-null, which apparently only happens when the component has a size. A tab that is shown for the first time probably does not have a size yet, especially because Editor.selectTab does not immediately make the tab visible, but uses SwingUtilities.invokeLater. On the other hand, repaintNewCaret() als runs inside invokeLater, but perhaps some things are even further delayed.

I haven't dug in more closely yet to see when the component size gets set exactly.

@per1234
Copy link
Collaborator Author

per1234 commented Sep 27, 2016

are you sure you mean 1.6.12 here? Or 1.6.11?

Sorry, that was a typo, I meant to write 1.6.11. I've edited my report with the correction.

@matthijskooijman matthijskooijman self-assigned this Jan 19, 2017
@ninja2B
Copy link

ninja2B commented Nov 20, 2018

Hey Mr Matthijs Kooijman, I understand you're a busy man, but I'm hoping I might prompt you to fix this annoying issue. As mentioned above this bug was introduced into the Arduino IDE somewhere after release 1.6.11 and it's still there in 1.8.7.

FYI my workaround when using the FIND dialogue box and searched text doesn't display: hit PREVIOUS then FIND again. This brings the text into view correctly. May be a useful clue?

(But it sure is an annoying weakness in the IDE)

You know the saying: "If you need something done, give it to a busy man" :-)

TIA

@matthijskooijman
Copy link
Collaborator

Hm, seems I assigned this to myself, so I should probably have a closer look (it did kind of fall of my radar). I've added it to my todolist again, but might still take a while...

@ninja2B
Copy link

ninja2B commented Nov 20, 2018

Good man, thanks. Happy to wait for a positive outcome :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-refactor Related to the refactoring of the Arduino IDE's editor component Type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants