Fix document switcher plugin with multiple splitted view.
Needs ReviewPublic

Authored by tristanp on Oct 5 2019, 5:22 PM.

Details

Reviewers
None
Group Reviewers
KDevelop
Summary

In differential D20548 an issue with document switcher plugin and
splitted views is described.
The solution is to open/activate document instead of activating
view (aka Sublime::View) as view are linked to area (aka Sublime::Area)
and will show again in same area instead of current active area.

But the differential solution was trying to retrieve the document
from activated view which is not the perfect way as it must handle
Sublime::UrlDocument to have a url for openDocument function.

This patch use the document controller (aka IDocumentController)
instead of sublime components.

The plugin tracks a list of document (aka IDocument) and
enables signals for open/activate/close actions.
Every document is placed in list model via DocumentSwitcherItem
class responsible of extracting text and icon from a document
passed in its constructor.

Without dependency to sublime, the plugin structure is
simplified by not taking care about active main window, active
area, and views. Only documents are tracking independently of the
way they are displayed in UI.

Diff Detail

Repository
R32 KDevelop
Branch
switch_doc_2
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17346
Build 17364: arc lint + arc unit
tristanp created this revision.Oct 5 2019, 5:22 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptOct 5 2019, 5:22 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
tristanp requested review of this revision.Oct 5 2019, 5:22 PM
tristanp added a comment.EditedOct 5 2019, 5:36 PM

With the patch :

Without :

Note that even if the left area is selected documents are switched only in right area.