Fix document switcher plugin with multiple splitted view.
Needs ReviewPublic

Authored by tristanp on Apr 14 2019, 4:31 PM.


Group Reviewers

When using multiple area indexes (splitted views) the document switcher
activated with Ctrl+Tab was always changing the document of the first
splitted view even if the second view was selected.

Looking at the plugin code, it uses a list of last enabled views (Sublime::View)
and activate a view thanks to Sublime::Window::activateView, but this function
only show a view in its container (Sublime:Container) which was used when adding
the view.

It tends to confirm that switching a view will always keep it in the same
area index.

To solve this issue, the behaviour of the document plugin (documentview) is
mimicked by using Sublime::[Url]Document instead of Sublime::View and call
openDocument from document controller. This function seems to automatically
detect if creating a new view is needed or a old can be reused depending on
the current area index.

Note: This is my first patch in this projet, please let me know if I miss anything.

Diff Detail

R32 KDevelop
No Linters Available
No Unit Test Coverage
Build Status
Buildable 10855
Build 10873: arc lint + arc unit
tristanp created this revision.Apr 14 2019, 4:31 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptApr 14 2019, 4:31 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
tristanp requested review of this revision.Apr 14 2019, 4:31 PM
apol added a subscriber: apol.Sun, Jun 30, 8:22 AM

Please clean the patch of whitespace changes.


This changes the behaviour. Earlier if the view wasn't a document, it would still be added. Did you intend to change this?