jump_back cursor history gets corrupted
Description of the bug
The jump_back history will get corrupted, causing the jump_back command to traverse a somewhat random set of positions in the open files. This happens with a frequency of maybe every other day.
Steps to reproduce
This is the problem: I don't have a repro besides "use ST (in safe more or not) for a time somehwere between a couple of minutes to a couple of hours". I know that this is completely useless for you, which is why I'm hoping you can guide me on how to diagnose this issue further.
Expected behavior
The jump_back command should go to the last cursor position. Repeated jump_back commands should traverse the cursor history up to some maximum depth.
Actual behavior
The jump_back command will stop going through the actual cursor history and instead jump seemingly randomly around in open files. It might decide to jump to places in the same file where the cursor has not been before (or traverse them out of order), it might decide to jump to open files where the cursor hasn't been for a long time, most often at the end of such a file, and it might even get stuck in loops, where continuously using jump_back will traverse the same small set of positions indefinitely. As far as I can tell it never opens new files.
Sublime Text build number
4126, but I have experienced this for at least 2 years.
Operating system & version
Windows 10
(Linux) Desktop environment and/or window manager
No response
Additional information
I have experienced this bug on 2 separate machines running Windows 10 for at least the past 2 years. After asking on the discord a couple of months ago about this, I tried running sublime in safe mode to see if this fixed anything, but the issue still persisted. I am willing to invest a bit of work into this (activating extended logging, trying different configurations, maybe even debugging if there is a possibility to do so) to investigate this issue further.
OpenGL context information
No response
I wrote that occasionally loops happen: That might be wrong. I just had a case where I thought I was in a loop, but it just jumped back and forth between two positions about 30 times (which I most definitely did not do!) and then went throught other positions again before reaching the end of the history.
I've been running into this too - I use jump back a lot. It happens after some time so it's hard to replicate but it seems very broken when it gets to a certain point.
This seems to happen especially often when I have the same file open in two views next to each other. When editing in one view for some time and then using the jump back command, it will often decide to jump to the other view.
Same here, since ST3, as reported: https://forum.sublimetext.com/t/jump-back-incorrectly-jumping-to-another-tab/59563?u=rogeriodec
Dear ST-Devs: Can you give an update on this? Is there anything you need or I can do to help? This issue has been a problem for a long time, and I hope you don't just let it sit here. It has been 8 months since I reported this issue, and the bug has existed for much longer, so I imagine this has popped up before (like on the discord, where I didn't get any help). Please fix this issue.
I also experience this. I never use multiple columns, so it's not that. Also I have been using ST for years and everything was fine. The appearance of this bug seems to coincide with me switching from Windows to Linux maybe 2 months ago, but since you're using Windows it's not simply that. I surely have been using the Windows version that you had the bug with in Jan 22 extensively with no problems.
I couldn't quite find a pattern in this yet. It is as you described. I think it's always an adjecent tab. Maybe they just get the keybinding wrong? I'm in wrong tabs suddenly. Maybe the position inside a tab is also corrupted and you just don't realize this as much as with being thrown into a wrong tab? I don't know. It's hard to replicate but it happens multiple times a day for me.
It's an essential feature and it being broken really sucks.
Another year, bug still here. Please fix this!
have you tried reinstalling everything? I might do that
Not deliberatly for this bug, but since I have had this issue across OS reinstalls, 2PCs and sublime 3 and 4, I don't have hope in a reinstall fixing it.
The history feature gets at least corrupt when you have "clones" or multiple views into the same buffer. That is easily reproducible.
maybe it helps if affected users list all user packages they have installed?
maybe it helps if affected users list all user packages they have installed?
This also happens with sublime safe mode, where packages shouldn't play a role (to my understanding).
To be fair, the whole "cursor history" feature is just sub-standard. If it works it jumps around in tiny steps; it seems more time-based (🙄) than actually location-based. Now, how fast do you type? And how fast was the original implementor compared to that?
To be fair, the whole "cursor history" feature is just sub-standard. If it works it jumps around in tiny steps; it seems more time-based (🙄) than actually location-based. Now, how fast do you type? And how fast was the original implementor compared to that?
I don't agree. Undo has the exact same problem, and people are (in general) fine with it. I assume that cursor history uses the same rules to determine what counts as a single movement vs a single edit, and it works fine for me (when it works). If you have issues with that part of cursor history, I guess opening a new issue might be the best course of action (assuming it doesn't just get ignored by the ST team for 2+ years like this issue).
I have been using the following to avoid the small jumps. It just keeps jumping till the view scrolls. That somewhat improved the usability I expect from the feature.
This post seems to tell the location of this command https://github.com/sublimehq/sublime_text/issues/1374#issuecomment-247934321 I haven't looked, in theory shouldn't be that hard to make something custom that works as you should expect (if the API behaves ..). In that same issue they seem to have provided some code to make it jump only on current view, but I haven't tried it.
class jump_back2(sublime_plugin.WindowCommand):
def run(self):
window = sublime.active_window()
view = window.active_view()
region = view.visible_region()
runs = 0
while region == view.visible_region():
window.run_command("jump_back")
runs += 1
if runs == 200:
break
class jump_forward2(sublime_plugin.WindowCommand):
def run(self):
window = sublime.active_window()
view = window.active_view()
region = view.visible_region()
runs = 0
while region == view.visible_region():
window.run_command("jump_forward")
runs += 1
if runs == 200:
break