Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[Editor] alignLine misreads the start location #2081

Closed
jasonLaster opened this issue Feb 22, 2017 · 3 comments
Closed

[Editor] alignLine misreads the start location #2081

jasonLaster opened this issue Feb 22, 2017 · 3 comments

Comments

@jasonLaster
Copy link
Contributor

I've noticed that while searching the editor can occassionally be a bit jumpy. The reason for this is that the editor thinks that the new search result is not visible and centers the result in the middle of the editor.

This is a bug in how we calculate the start and last visible line of the document: here

Here are some screenshots of searching where the match is visible, but codemirror thinks it's not:

One other thought, this is likely CSS and could work on firefox, but fail on chrome

search

screen shot 2017-02-22 at 4 50 55 pm

alignLine

screen shot 2017-02-22 at 4 51 04 pm

@rrandom
Copy link
Contributor

rrandom commented Mar 3, 2017

Hi, @jasonLaster , I found that set "viewportMargin": Infinity when create the editor instance will fix this. But it's not recommend by Codemirror https://codemirror.net/doc/manual.html#option_viewportMargin

@jasonLaster
Copy link
Contributor Author

jasonLaster commented Mar 3, 2017 via email

@jasonLaster
Copy link
Contributor Author

I think this is fixed by firefox-devtools/devtools-core#515

@jasonLaster jasonLaster removed this from Priority Ordered in Bug Triage Aug 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants