spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.2k stars 1.59k forks source link

Highlight instances not shown when scrolling #14268

Closed OverLordGoldDragon closed 3 years ago

OverLordGoldDragon commented 3 years ago

Demo vs 4.1.5

ccordoba12 commented 3 years ago

That's per design: from 4.2.0 onwards we'll only highlight occurrences in the visible portion of the file to avoid delays in the editor when trying to highlight a potentially very high number.

If you have a better idea on how to fix that and are willing to invest time to do it, we're welcome to hear it. Otherwise, please feel free to close this issue.

OverLordGoldDragon commented 3 years ago

@ccordoba12 I see. Couldn't one of following be done instead?:

  1. Highlight within plusminus X lines of current view
  2. Highlight up to Y occurrences outside of current view

This way most usage of local scrolling is accounted for without having to hit all matches.

ccordoba12 commented 3 years ago

Thanks for the suggestions. Point 1 is already implemented and 2 would require resources we didn't plan for in the next months.

Besides, the scrollflag on the right (next to the vertical scrollbar) signals where all occurrences are, so you can jump anywhere to the file and wait a little bit for them to appear. And it works the same for all other kinds of highlights in the editor.

So it's up to you if want to see this implemented before the next six months.

OverLordGoldDragon commented 3 years ago

@ccordoba12 Hmm, you're right, there's a little bit of 1. This is fairly bothersome as I relied much on this highlighting, but sidebar preserving instances does help - guess can adapt to it. Dropping the ! for pdb is the biggest plus for me in 4.2.0.

One more idea - 3: keep usual highlighting unless number of lines exceed Z (just like for code folding).

ccordoba12 commented 3 years ago

Ok, that's a good idea. We'll see what we can do to improve this in 4.2.2.

Archi712 commented 3 years ago

On my computer (Windows 10 and Python 38-32) after scroll, the occurencies doesn't highlight even if I wait long time. They appear only for a brief moment when I click inside the code window. But suddenly the highlight point is changed and so are changed the little purple indicators in the sidebar.

lagunabravo commented 3 years ago

I have the same problem as @Archi712 (Spyder 4.2.3, Windows 10). When I scroll the highlights never (never) happen past a few lines beyond the view.

highlights

You never realise how much you rely on some great features, until you lose them. I find myself now squinting through the code trying to find something that was so easy to find before. Great work anyway :-)

ccordoba12 commented 3 years ago

@lagunabravo, you need to stop and wait for a bit (less than a second) to see the occurrences painted in the screen. If you scroll constantly, they won't be updated.

We had to do that to avoid serious performance issues while trying to paint hundreds of occurrences in very long documents.

lagunabravo commented 3 years ago

Thank you for your prompt reply @ccordoba12 I may have some setting wrong but, if I select something the occurrences show up in the sidebar after a short time. If I then scroll, only a few lines past the initial view the occurrences stop being highlighted (as per screenshot before). No matter how long I wait, or if I scroll fast or slow. Any suggestions?

Archi712 commented 3 years ago

Yesterday I installed spyder 4.2.3 and have the same problem.

It doesn’t matter how much time I wait, highlighting never happen. Highlighting appear only for a brief moment when I click inside the window.

If could be of any help, I could add that I don’t scroll the page with arrow buttons, but I click directly in the vertical bar where I see blue dashes.

Best regards. Riccado.

Da: lagunabravo @.> Inviato: mercoledì 17 marzo 2021 05:19 A: spyder-ide/spyder @.> Cc: Carassale Riccardo @.>; Mention @.> Oggetto: [EXTERNAL] Re: [spyder-ide/spyder] Highlight instances delayed when scrolling (#14268)

Thank you for your prompt reply @ccordoba12https://urldefense.com/v3/__https:/github.com/ccordoba12__;!!JZsaRFfwqOYHaA!g9Q8_8IEpQAltuMccp3ICBzmC_SK6-pZ5mNDvpnPzGiGB0JDZekPagveef96ZK6Vs7c_21okBpE$ I may have some setting wrong but, if I select something the occurrences show up in the sidebar after a short time. If I then scroll, only a few lines past the initial view the occurrences stop being highlighted (as per screenshot before). No matter how long I wait, or if I scroll fast or slow. Any suggestions?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/spyder-ide/spyder/issues/14268*issuecomment-800781403__;Iw!!JZsaRFfwqOYHaA!g9Q8_8IEpQAltuMccp3ICBzmC_SK6-pZ5mNDvpnPzGiGB0JDZekPagveef96ZK6Vs7c_510qWZs$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AQAN4LKSSGEYBP3DSJ5I7NDTEAUSNANCNFSM4T3W7FJA__;!!JZsaRFfwqOYHaA!g9Q8_8IEpQAltuMccp3ICBzmC_SK6-pZ5mNDvpnPzGiGB0JDZekPagveef96ZK6Vs7c_JGa6Pls$.

P Prima di stampare questa comunicazione consideratene, per favore, l'impatto ambientale Please consider the environment before printing this email.


Questo messaggio e i suoi allegati sono confidenziali e destinati ad essere inviati esclusivamente ai destinatari effettivi per gli scopi e gli usi previsti. Qualsiasi uso, distribuzione, riproduzione o divulgazione da e verso qualsiasi persona diversa dagli utenti previsti é severamente vietata. Se hai ricevuto questo messaggio per errore, ti invitiamo a informare immediatamente il destinatario e ad eliminarlo dal tuo sistema. Ansaldo Energia S.p.A. tratta i dati per finalità connesse alla richieste formulate e al corretto svolgimento del rapporto in essere. Informazioni dettagliate sono riportate nell'informativa privacy sul sito internet della società, www.ansaldoenergia.com, e potranno essere richieste via e-mail a @.***, a cui poter indirizzare anche eventuali richieste di accesso.

This message and its attachments are confidential intended to be sent exclusively to the actual recipients for the intended purposes and uses. Any use, distribution, reproduction or disclosure to and from any person other than the intended users is strictly prohibited. If you have received this message by mistake, we invite you to notify the recipient immediately and to delete it from your system. Ansaldo Energia S.p.A. processes the data for purposes related to the request formulated and the correct execution of the existing relationship. Detailed information can be found in the privacy policy on company's website, www.ansaldoenergia.com, and can be requested by e-mail to @.*** , to which any access requests may also be addressed.

scnas commented 3 years ago

Hi, I confirm the bug is also present for me when the option Completion and linting > Linting > Underline errors and warnings is enabled. Same symptoms: the occurrences are not highlighted until a click is made in the editor window, then quickly disappear after a time equal to Editor > Display > Highlight occurrences after. Normal behaviour is restored when the option Underline errors and warnings is disabled.

Affected from 4.2.* until now 5.0.5

OverLordGoldDragon commented 3 years ago

Maybe move to ux? @ccordoba12

ccordoba12 commented 3 years ago

I think that's a problem we need to fix here.

ccordoba12 commented 3 years ago

Thanks @supercoder-nassim for your comment above! That's what really what led me to find and fix this error.

The fix will be available in our 5.1.2 version, to be released shortly.

ccordoba12 commented 3 years ago

@OverLordGoldDragon, your original problem can't really be addressed for performance reasons, sorry.

OverLordGoldDragon commented 3 years ago

@ccordoba12 I've gotten used to utilizing the sidebar, so fine with me - though wonder if it's just Spyder, I've not seen this issue in other IDEs.

ccordoba12 commented 3 years ago

though wonder if it's just Spyder, I've not seen this issue in other IDEs.

Good point. I tested with VSCode and indeed it doesn't show this behavior. I'll revisit this problem later to see if I can make some improvements to it.

scnas commented 3 years ago

Thanks @supercoder-nassim for your comment above! That's what really what led me to find and fix this error.

The fix will be available in our 5.1.2 version, to be released shortly.

Thank you @ccordoba12 Spyder is awesome software thanks to you guys, keep up the good work !