Cudatext: "Top line index" is not restored from session for passive tabs

Created on 28 Jan 2021  路  27Comments  路  Source: Alexey-T/CudaText

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.

bug

All 27 comments

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

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

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

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

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

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

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 馃槺

Yes; seems last Lazarus update is broken, confirmed

Laz reverted to some old version, beta updated!

Favorites plugin is working but CudaExt is not working:

image

This option no show anything.

Posted to new issue.

@Jairo-Martinez let's test this?

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.

Good catch! beta fixed+updated.

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

(pls, to a new issue)

  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)

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

@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

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.

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

Sure

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

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

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.

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

Answered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JairoMartinezA picture JairoMartinezA  路  7Comments

xcme picture xcme  路  5Comments

JairoMartinezA picture JairoMartinezA  路  5Comments

EchedeyLR picture EchedeyLR  路  3Comments

JairoMartinezA picture JairoMartinezA  路  7Comments