@@ -69,7 +69,7 @@ import { Workspace } from "./../../Services/Workspace"
69
69
70
70
import { Editor } from "./../Editor"
71
71
72
- import { BufferManager , IBuffer } from "./../BufferManager"
72
+ import { BufferManager } from "./../BufferManager"
73
73
import { CompletionMenu } from "./CompletionMenu"
74
74
import { HoverRenderer } from "./HoverRenderer"
75
75
import { NeovimPopupMenu } from "./NeovimPopupMenu"
@@ -94,8 +94,6 @@ import CommandLine from "./../../UI/components/CommandLine"
94
94
import ExternalMenus from "./../../UI/components/ExternalMenus"
95
95
import WildMenu from "./../../UI/components/WildMenu"
96
96
97
- import { WelcomeBufferLayer } from "./WelcomeBufferLayer"
98
-
99
97
import { CanvasRenderer } from "../../Renderer/CanvasRenderer"
100
98
import { WebGLRenderer } from "../../Renderer/WebGL/WebGLRenderer"
101
99
import { getInstance as getNotificationsInstance } from "./../../Services/Notifications"
@@ -148,6 +146,7 @@ export class NeovimEditor extends Editor implements Oni.Editor {
148
146
private _bufferLayerManager = getLayerManagerInstance ( )
149
147
private _screenWithPredictions : ScreenWithPredictions
150
148
149
+ private _onShowWelcomeScreen = new Event < void > ( )
151
150
private _onNeovimQuit : Event < void > = new Event < void > ( )
152
151
153
152
private _autoFocus : boolean = true
@@ -156,6 +155,10 @@ export class NeovimEditor extends Editor implements Oni.Editor {
156
155
return this . _onNeovimQuit
157
156
}
158
157
158
+ public get onShowWelcomeScreen ( ) {
159
+ return this . _onShowWelcomeScreen
160
+ }
161
+
159
162
public get /* override */ activeBuffer ( ) : Oni . Buffer {
160
163
return this . _bufferManager . getBufferById ( this . _lastBufferId )
161
164
}
@@ -309,7 +312,7 @@ export class NeovimEditor extends Editor implements Oni.Editor {
309
312
310
313
// Services
311
314
const onColorsChanged = ( ) => {
312
- const updatedColors : any = this . _colors . getColors ( )
315
+ const updatedColors = this . _colors . getColors ( )
313
316
this . _actions . setColors ( updatedColors )
314
317
}
315
318
@@ -834,6 +837,12 @@ export class NeovimEditor extends Editor implements Oni.Editor {
834
837
this . _neovimInstance . autoCommands . executeAutoCommand ( "FocusLost" )
835
838
}
836
839
840
+ public async createWelcomeBuffer ( ) {
841
+ const buf = await this . openFile ( "WELCOME" )
842
+ await buf . setScratchBuffer ( )
843
+ return buf
844
+ }
845
+
837
846
public async clearSelection ( ) : Promise < void > {
838
847
await this . _neovimInstance . input ( "<esc>" )
839
848
await this . _neovimInstance . input ( "a" )
@@ -1034,8 +1043,7 @@ export class NeovimEditor extends Editor implements Oni.Editor {
1034
1043
await this . openFiles ( filesToOpen , { openMode : Oni . FileOpenMode . Edit } )
1035
1044
} else {
1036
1045
if ( this . _configuration . getValue ( "experimental.welcome.enabled" ) ) {
1037
- const buf = await this . openFile ( "WELCOME" )
1038
- buf . addLayer ( new WelcomeBufferLayer ( ) )
1046
+ this . _onShowWelcomeScreen . dispatch ( )
1039
1047
}
1040
1048
}
1041
1049
@@ -1100,8 +1108,8 @@ export class NeovimEditor extends Editor implements Oni.Editor {
1100
1108
< Provider store = { this . _store } >
1101
1109
< NeovimSurface
1102
1110
onFileDrop = { this . _onFilesDropped }
1103
- autoFocus = { this . _autoFocus }
1104
1111
renderer = { this . _renderer }
1112
+ autoFocus = { this . _autoFocus }
1105
1113
typingPrediction = { this . _typingPredictionManager }
1106
1114
neovimInstance = { this . _neovimInstance }
1107
1115
screen = { this . _screen }
@@ -1126,10 +1134,10 @@ export class NeovimEditor extends Editor implements Oni.Editor {
1126
1134
}
1127
1135
1128
1136
// Check if any of the buffer layers can handle the input...
1129
- const buf : IBuffer = this . activeBuffer as IBuffer
1130
- const result = buf && buf . handleInput ( key )
1137
+ const buf = this . activeBuffer
1138
+ const layerInputHandler = buf && buf . handleInput ( key )
1131
1139
1132
- if ( result ) {
1140
+ if ( layerInputHandler ) {
1133
1141
return
1134
1142
}
1135
1143
0 commit comments