3

Resolved

Don't add "document" text view role to REPL window

description

When PTVS is used in combination with the VsVim extension, the REPL windows get VsVim and VsVim keybindings, which is unexpected and unhelpful. I believe this is because the window is created with the "document" text view role:

https://pytools.codeplex.com/SourceControl/latest#Common/Product/ReplWindow/Repl/ReplWindow.cs
            return textEditorFactoryService.CreateTextViewRoleSet(
                PredefinedTextViewRoles.Analyzable,
                PredefinedTextViewRoles.Editable,
                PredefinedTextViewRoles.Interactive,
                PredefinedTextViewRoles.PrimaryDocument,
                PredefinedTextViewRoles.Zoomable,
                PredefinedTextViewRoles.Document,
                ReplConstants.ReplTextViewRole
            );
By convention, REPL windows do not use the "document" text view role. For example, consider the NuGet package manager console window:

https://github.com/anurse/NuGet/blob/master/src/VsConsole/Console/Console/WpfConsole.cs
                    var textViewRoleSet = Factory.TextEditorFactoryService.CreateTextViewRoleSet(
                        PredefinedTextViewRoles.Interactive,
                        PredefinedTextViewRoles.Editable,
                        PredefinedTextViewRoles.Analyzable,
                        PredefinedTextViewRoles.Zoomable);
and, empirically at least, it would seem the C# and F# Interactive windows do not use the "document" role either.

comments