Skip to content
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

"Top line index" is not restored from session for passive tabs #3112

Closed
JairoMartinezA opened this issue Jan 28, 2021 · 27 comments
Closed

"Top line index" is not restored from session for passive tabs #3112

JairoMartinezA opened this issue Jan 28, 2021 · 27 comments
Labels

Comments

@JairoMartinezA
Copy link

Hi @Alexey-T
Testing with two opened files and saving the session:

image

If my last caret position is in the far-left tab when I close CT, if I start again CT, CT shows me this first tab and scrolls the window to show me that last line (as the previous picture). But if my last edited line is the second tab, when I restart CT, in this case CT shows me indeed the second tab but not scrolls to this caret position (I need to use directions keys or start the typing):

image

My feature request :bowtie: is set CT to scroll to last caret in each file when I restart the editor.

@Alexey-T
Copy link
Owner

Thanks for report- looks like a bug with initial scroll pos lost.

@Alexey-T Alexey-T added the bug label Jan 28, 2021
Alexey-T added a commit to Alexey-T/ATSynEdit that referenced this issue Jan 28, 2021
@Alexey-T
Copy link
Owner

Fixed for 'word wrap off' in user.json
Tofix! for 'word wrap on' (1).

@Alexey-T Alexey-T changed the title Remember and scroll to last position with two+ tabs in opening CudaText "Top line index" is not restored from session for passive tabs Jan 28, 2021
@Alexey-T
Copy link
Owner

Alexey-T commented Jan 28, 2021

Made more fixing; will post beta tomorrow (GMT+3 morning)

@Alexey-T
Copy link
Owner

Alexey-T commented Jan 29, 2021

Beta updated; let's tets it. Not simple fix, need to test
http://uvviewsoft.com/c/
test with "wrap_mode":0 and :1 (user.json).
with several files in session with different 'index of top visible line'.

@tmsg-gh @kvichans

@JairoMartinezA
Copy link
Author

Something is happening with my installed plugins, with the beta upgrade they are not working anymore. I am still with more validations.

@Alexey-T
Copy link
Owner

Alexey-T commented Jan 29, 2021

cudatext.py file must be updated! it may crash python code, if not.

@JairoMartinezA
Copy link
Author

I am testing now with a fresh install and after that I proceeded to install Favorites plugin, is not working, the same with Cuda-Ext both of @kvichans 😱

@Alexey-T
Copy link
Owner

Yes; seems last Lazarus update is broken, confirmed

@Alexey-T
Copy link
Owner

Laz reverted to some old version, beta updated!

@JairoMartinezA
Copy link
Author

Favorites plugin is working but CudaExt is not working:

image

This option no show anything.

@Alexey-T
Copy link
Owner

Posted to new issue.

@Alexey-T
Copy link
Owner

@jairo-martinez let's test this?

@JairoMartinezA
Copy link
Author

Issue found:

  1. Open CT and open 3 files.
  2. Move files to different positions to test the functionality (Obviously you need to make click in the other tabs).
  3. Restart CT
  4. CT remembers and scroll to last position (Making a click on each opened tab)
  5. Restart CT
  6. Focus just in current tab and don't click in any another tab.
  7. Restart CT again.
  8. In this case CT is not scrolling to last position when you validate the other tabs.

Alexey-T added a commit to Alexey-T/ATSynEdit that referenced this issue Jan 29, 2021
@Alexey-T
Copy link
Owner

Good catch! beta fixed+updated.

@JairoMartinezA
Copy link
Author

Let me test again, I found another issue painting lexer colors with Word-Wrap enabled but I will try to repro.

@Alexey-T
Copy link
Owner

(pls, to a new issue)

@JairoMartinezA
Copy link
Author

  1. Open CT and open many files.
  2. In current tab move to some position.
  3. Restart CT remember the position but move around 6 lines above the scroll.
  4. Don't do anything and restart again CT.
  5. CT moves again the scroll another 6 lines and eventually the caret is lost (visually)

@Alexey-T
Copy link
Owner

do you mean that after restart, CT shows scroll position ONE line lower than needed? I saw that too, so confirm.

@Alexey-T
Copy link
Owner

Alexey-T commented Jan 29, 2021

@jairo-martinez If you reply 'yes' to above, let's find-- is it new issue (with that ONE line shift) or the old one?
old Cud versions- how do they do?
if it is old issue- I will delay the fix, after release.

note: this issue needs "wrap_mode":1

@JairoMartinezA
Copy link
Author

Yes, it is related to "wrap_mode":1

I am repeating the test with a fresh install, let me a couple of minutes to found exactly the steps to repro.

@Alexey-T
Copy link
Owner

(let's post a new issue. the SUBJ is solved)

@JairoMartinezA
Copy link
Author

Sure

@JairoMartinezA
Copy link
Author

Question @Alexey-T, the functionality to move the scroll, it is using the last caret position or the last scroll position?

@Alexey-T
Copy link
Owner

caret position is not relative at all. caret can be at end-of-file.

@JairoMartinezA
Copy link
Author

So?

Because currently If I put the cursor at line 50, but I scroll the windows to see the line 400, after restart CT, CT shows me this last scroll position, is not moving to line 50, but the caret remains in the line 50.

@Alexey-T
Copy link
Owner

CT saves 2 numbers to session: caret pos, top line index

@JairoMartinezA
Copy link
Author

Answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants