Imaginary-Teleprompter icon indicating copy to clipboard operation
Imaginary-Teleprompter copied to clipboard

Find resets editor position upon closing

Open videosmith opened this issue 2 years ago • 4 comments

When I click on the magnifying glass and search for text, the script updates to the selected text location, however when you close the the Find tool, the script resets to the top. Is there a way to maintain the script position after the Find tool is closed?

videosmith avatar Aug 19 '21 14:08 videosmith

Bug confirmed, this should be fixed for 2.5.

@videosmith, thank you for all the feedback. I found a quick workaround that should help you for now. The text found continues to be selected after the scroll jumps back to the start. This means you can go back to the found location by pressing the left or right arrow keys after closing the find tool.

Cuperino avatar Aug 19 '21 18:08 Cuperino

Thank you. That helps.

FYI, I attempted to search for a few numbers on your sample script, received a 'specified text was not found' error - may not be able to locate numbered bullet points.

Curiously, '5' was able to be located by the Find tool - possibly related to aq nearby Anchor attached?

videosmith avatar Aug 19 '21 19:08 videosmith

That curiosity is due to a property of HTML, which we can do nothing about. Lists can be ordered (numbered) or unordered (bullets). Ordered lists have their numbers added automatically by the browser and do not appear in search results, because the numbers are not a part of the document object model (DOM) being searched.

When searching for 5, you're actually being shown the 5 from "Try pressing '5' now!", which is currently located at the 6th element of the list, thus giving the impression that Find takes you to list element number 5, but in reality it's showing element number 6, because search results are shown at the bottom of the page.

Ordered lists are useful to prevent numbering errors when adding or removing elements. Unfortunately, they can't be searched for without having direct control over the browser's DOM parser (which is not possible on Imaginary Teleprompter) or using two separate DOM parsers and models with expensive to write, inefficient to run, and hard to maintain source code to keep them in sync.

Cuperino avatar Aug 19 '21 20:08 Cuperino

Understood and thanks for the clarification. On Thursday, August 19, 2021, 04:45:59 PM EDT, Javier O. Cordero Pérez @.***> wrote:

That curiosity is due to a property of HTML, which we can do nothing about. Lists can be ordered (numbered) or unordered (bullets). Ordered lists have their numbers added automatically by the browser and do not appear in search results, because the numbers are not a part of the document object model (DOM) being searched.

When searching for 5, you're actually being shown the 5 from "Try pressing '5' now!", which is currently located at the 6th element of the list, thus giving the impression that Find takes you to list element number 5, but in reality it's showing element number 6, because search results are shown at the bottom of the page.

Ordered lists are useful to prevent numbering errors when adding or removing elements. Unfortunately, they can't be searched for without having direct control over the browser's DOM parser or using two separate DOM parsers and models with expensive to write, inefficient to run, and hard to maintain source code to keep them in sync.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

videosmith avatar Aug 19 '21 21:08 videosmith