Home Download Buy Blog Forum Support

Behaviour after closing a tab and placement of close button

Re: Behaviour after closing a tab and placement of close button

Postby facelessuser on Thu Feb 27, 2014 7:13 am

Tab rearranging shouldn't have any effect. Try restarting ST tomorrow and playing with it. If you can give me more specific details on how to reproduce an the issue, I can probably do something. Rearranging tabs on my system has no adverse effect.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: Behaviour after closing a tab and placement of close button

Postby gorg on Thu Feb 27, 2014 3:21 pm

I get inconsistent behaviour after closing all tabs or window (in Mac). Both with 3059 and 3061, Mac/Linux.

mkdir tabs
touch tabs/{1..7}.txt
subl3 tabs/{1..7}.txt


(7.txt is activated)

activate: 1,3,5,7,2,4,6

start closing all tabs either by shortcut or mouse: 1st time it works. Repeat opening and activating the {1..7}.txt files and it gets confused.
Last edited by gorg on Thu Feb 27, 2014 4:50 pm, edited 1 time in total.
gorg
 
Posts: 12
Joined: Tue Feb 25, 2014 2:48 pm

Re: Behaviour after closing a tab and placement of close button

Postby facelessuser on Thu Feb 27, 2014 3:36 pm

gorg wrote:I get inconsistent behaviour after closing all tabs or window (in Mac). Both with 3059 and 3061, Mac/Linux.

mkdir tabs
touch tabs/{1..7}.txt
subl3 tabs/{1..7}.txt


(7.txt os activated)

activate: 1,3,5,7,2,4,6

start closing all tabs either by shortcut or mouse: 1st time it works. Repeat opening and activating the {1..7}.txt files and it gets confused.


I will check this later today. It is possible I get in a bad state and am no longer timestamping the views or miss some. I try to guard against timestamping certain focus calls I do when closing the files so not to update the timestamp when batch closing the files. It is possible a flag is getting set in a bad state. I will let you know later, but I think this can be ironed out.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: Behaviour after closing a tab and placement of close button

Postby facelessuser on Thu Feb 27, 2014 5:45 pm

I had some syntax issues and a case where a close gets called with views at index -1. I just pushed fixes for those.

What was probably happening was, apparently sublime when there are no views open, and you open a new file, sublime closes some invisible view with index -1. So that probably caused the listener class to bomb, and then it couldn't detect tabs closes anymore.

Update and give the new version a try. You may need to restart.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: Behaviour after closing a tab and placement of close button

Postby gorg on Sat Mar 01, 2014 1:00 am

facelessuser, thanks for your hard work. The problem with the wrong indexing after closing all tabs or the program window has been solved. But still there is a problem with updating the idnexing queue if tabs are rearranged. In my previous example:

Open (or activate) in order: 1,2,3,4,5,6,7

then activate 2 and move it a few places, e.g. after 5 and before 6. After closing 2, 1 gets the focus instead of 7.
gorg
 
Posts: 12
Joined: Tue Feb 25, 2014 2:48 pm

Re: Behaviour after closing a tab and placement of close button

Postby facelessuser on Sat Mar 01, 2014 2:57 am

I found out why it does it...not sure yet what I can do.

The reason it gets "confused" is because when you move a tab, it activates the tab to its left, and then re-activates the tab that got moved.

So when you move tab 2 between 5 and 6, tab 1 gets activated, and then tab 2 gets re-activated. The only way to fix this is somehow detect the tab 1 is getting activated because of a move. It is possible I can save the tab ids or something and if tab ids are all the same, but re-ordered, then the activation can be ignored. I might try it out this weekend. If it works, I will let you know.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: Behaviour after closing a tab and placement of close button

Postby facelessuser on Sun Mar 02, 2014 12:03 am

Turns out the fix was a bit easier than I thought it would be. The tab on move is actually removed from the window. That is why the adjacent tab gets selected. But I put in a fix to detect when this "move" is occurring, and it should skip timestampping the adjacent view during move.

Give it a try. Hopefully, I finally have it working reasonably in most scenarios now.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: Behaviour after closing a tab and placement of close button

Postby gorg on Sun Mar 02, 2014 4:54 am

That should do it. It works great. You did a good job. Thanks! If I find any problems in the future or have an interesting suggestion I will contact you.
gorg
 
Posts: 12
Joined: Tue Feb 25, 2014 2:48 pm

Previous

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 13 guests