[txmt-dev] Re: Split Views Implementation

Jacob Carlborg doob at me.com
Fri Jan 2 11:50:38 UTC 2015


On 2014-12-31 21:21, Steven Clukey wrote:
> I’ve created an implementation of split views in TextMate. It is basically complete, except for one issue that I haven’t been able to fix and I am asking for help on this. I am posting it here rather than creating a Pull Request for several reasons. First, the known issue can be pretty serious, though it is not common in normal use. Second, my commits generally need work (which I appreciate, btw) and given the number of commits this may take some time to be ready for master. Third, I don’t want the pull request to become like the GitHub issue for split views, so I thought it would be better to post it here to work on, then when ready for master I’ll submit a Pull Request that can be merged quickly.
>
> The usage is fairly simple, there are 4 new options in the View menu to control the splitting. The tab bar is global, it shows all the open document and the currently active document is highlighted. Selecting a new document in the tab bar will change the currently active split to show that document. Closing a document closes it from all of the splits that are showing it. The active document is changed by clicking inside a document (or menu options in Windows). Thats pretty much it.
>
> Now the issue: if there are many documents open and they are closed “too fast" (holding CMD+W works) then the coherence of the documents is lost and the windows may end up in a state where closing “Untitled” opens “Untitled 2”, and closing “Untitled 2” opens “Untitled” and the window doesn’t close. Worse yet, the splits do not show a new document, they show documents that should have already been closed. I believe this is caused by the fact that `openAndSelectDocument` is somewhat asynchronous, and “too fast” perhaps means that the documents are closed faster than the new documents are open. But, since I have not been able to fix this problem perhaps my assessment is wrong.
>
> The implementation is on my fork:
> https://github.com/sclukey/textmate/commits/split_views

This is awesome :D.

I few comments:

* I noted there are some issues with synchronizing the tabs and the 
content. If I open a file from the file browser it will open a new tab, 
show the correct content but the previous tab is selected. If I open 
another file the tab for the last opened file before that is selected. 
This is when no split view is active

* When there's a vertical split and TextMate is not the active 
application, the left border of the gutter is gone. The same thing 
happens for a horizontal split but for the bottom border of the status bar

* It would be nice to have hotkeys for splitting and switch between the 
splits

* Personally I think the way you implemented the split view is a bit 
confusing. If there are two tabs open and one split. Each file is show 
in one view of the split. I would expect clicking a tab would active the 
corresponding split view, not chaining the content in the current split 
view.

Alternatively implement separate split views for each tab, this is how 
both iTerm and Xcode work.

-- 
/Jacob Carlborg



More information about the textmate-dev mailing list