MCPcopy
hub / github.com/Eugeny/tabby / constructor

Method constructor

tabby-core/src/components/splitTab.component.ts:259–369  ·  view source on GitHub ↗

@hidden

(
        private hotkeys: HotkeysService,
        private tabsService: TabsService,
        private tabRecovery: TabRecoveryService,
        injector: Injector,
    )

Source from the content-addressed store, hash-verified

257
258 /** @hidden */
259 constructor (
260 private hotkeys: HotkeysService,
261 private tabsService: TabsService,
262 private tabRecovery: TabRecoveryService,
263 injector: Injector,
264 ) {
265 super(injector)
266 this.root = new SplitContainer()
267 this.setTitle('')
268
269 this.focused$.subscribe(() => {
270 this.getAllTabs().forEach(x => x.emitFocused())
271 if (this.focusedTab) {
272 this.focus(this.focusedTab)
273 } else {
274 this.focusAnyIn(this.root)
275 }
276 })
277 this.blurred$.subscribe(() => this.getAllTabs().forEach(x => x.emitBlurred()))
278 this.visibility$.subscribe(visibility => this.getAllTabs().forEach(x => x.emitVisibility(visibility)))
279
280 this.tabAdded$.subscribe(() => this.updateTitle())
281 this.tabRemoved$.subscribe(() => this.updateTitle())
282
283 this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
284 if (!this.hasFocus || !this.focusedTab) {
285 return
286 }
287 switch (hotkey) {
288 case 'split-right':
289 this.splitTab(this.focusedTab, 'r')
290 break
291 case 'split-bottom':
292 this.splitTab(this.focusedTab, 'b')
293 break
294 case 'split-top':
295 this.splitTab(this.focusedTab, 't')
296 break
297 case 'split-left':
298 this.splitTab(this.focusedTab, 'l')
299 break
300 case 'pane-nav-left':
301 this.navigate('l')
302 break
303 case 'pane-nav-right':
304 this.navigate('r')
305 break
306 case 'pane-nav-up':
307 this.navigate('t')
308 break
309 case 'pane-nav-down':
310 this.navigate('b')
311 break
312 case 'pane-nav-previous':
313 this.navigateLinear(-1)
314 break
315 case 'pane-nav-next':
316 this.navigateLinear(1)

Callers

nothing calls this directly

Calls 14

getAllTabsMethod · 0.95
focusMethod · 0.95
focusAnyInMethod · 0.95
updateTitleMethod · 0.95
splitTabMethod · 0.95
navigateMethod · 0.95
navigateLinearMethod · 0.95
navigateSpecificMethod · 0.95
maximizeMethod · 0.95
resizePaneMethod · 0.95
setTitleMethod · 0.45

Tested by

no test coverage detected