@@ -32,6 +32,7 @@ import {
32
32
_getByteLen ,
33
33
_getClipboardText ,
34
34
_getSelection ,
35
+ _hash ,
35
36
_html ,
36
37
_isEmpty ,
37
38
_isPad ,
@@ -43,12 +44,11 @@ import {
43
44
_parsePixelFromValue ,
44
45
_pointInRect ,
45
46
_screenType ,
46
- _hash ,
47
47
} from " ~/common/util.ts" ;
48
- import api , {getOptions , register , rename , unregister } from " ~/common/api" ;
48
+ import api , {getConfiguration , register , rename , unregister } from " ~/common/api" ;
49
49
import {DEFAULT_COMMANDS , WINDOW_STYLE } from " ~/common/configuration.ts" ;
50
50
import {_parseANSI } from " ~/ansi" ;
51
- import store from " ~/common/store" ;
51
+ import { getStore } from " ~/common/store" ;
52
52
import THeader from " ~/components/THeader.vue" ;
53
53
import TViewerNormal from " ~/components/TViewerNormal.vue" ;
54
54
import TViewerJson from " ~/components/TViewerJson.vue" ;
@@ -704,14 +704,14 @@ const getThemeStyleId = (salt: string): string => {
704
704
* @param theme
705
705
*/
706
706
const setTheme = (theme : string ) => {
707
- let customThemes = getOptions ().themes
708
- let themeStyle
707
+ let customThemes = getConfiguration ().themes
708
+ let themeStyle: string
709
709
if (customThemes && customThemes [theme ]) {
710
710
themeStyle = customThemes [theme ]
711
711
} else if (theme === ' dark' ) {
712
- themeStyle = themeDark
712
+ themeStyle = themeDark as string
713
713
} else if (theme === ' light' ) {
714
- themeStyle = themeLight
714
+ themeStyle = themeLight as string
715
715
} else {
716
716
console .warn (" The specified terminal theme style was not found:" , theme )
717
717
return
@@ -751,7 +751,7 @@ const changeThemeFlag = (newNameKey: string, oldNameKey: string) => {
751
751
752
752
const _clearLog = (clearHistory : boolean ) => {
753
753
if (clearHistory ) {
754
- store .clear (getName ())
754
+ getStore () .clear (getName ())
755
755
} else {
756
756
terminalLog .value = [];
757
757
logSize .value = 0 ;
@@ -1304,7 +1304,7 @@ const _jumpToBottom = (enforce: boolean = false) => {
1304
1304
const _saveCurCommand = () => {
1305
1305
let cmd = command .value = command .value .trim ()
1306
1306
if (cmd .length > 0 ) {
1307
- store .push (getName (), cmd )
1307
+ getStore () .push (getName (), cmd )
1308
1308
}
1309
1309
1310
1310
let group = _newTerminalLogGroup ()
@@ -1455,21 +1455,21 @@ const _switchTipsSelectedIdx = (idx: number) => {
1455
1455
}
1456
1456
1457
1457
const _switchPreCmd = () => {
1458
- let cmdLog = store .getLog (getName ())
1459
- let cmdIdx = store .getIdx (getName ())
1458
+ let cmdLog = getStore () .getLog (getName ())
1459
+ let cmdIdx = getStore () .getIdx (getName ())
1460
1460
if (cmdLog .length !== 0 && cmdIdx > 0 ) {
1461
1461
cmdIdx -= 1 ;
1462
1462
command .value = cmdLog [cmdIdx ] ? cmdLog [cmdIdx ] : ' ' ;
1463
1463
}
1464
1464
_resetCursorPos ()
1465
- store .setIdx (getName (), cmdIdx )
1465
+ getStore () .setIdx (getName (), cmdIdx )
1466
1466
_searchCmd ()
1467
1467
_jumpToBottom (true )
1468
1468
}
1469
1469
1470
1470
const _switchNextCmd = () => {
1471
- let cmdLog = store .getLog (getName ())
1472
- let cmdIdx = store .getIdx (getName ())
1471
+ let cmdLog = getStore () .getLog (getName ())
1472
+ let cmdIdx = getStore () .getIdx (getName ())
1473
1473
if (cmdLog .length !== 0 && cmdIdx < cmdLog .length - 1 ) {
1474
1474
cmdIdx += 1 ;
1475
1475
command .value = cmdLog [cmdIdx ] ? cmdLog [cmdIdx ] : ' ' ;
@@ -1478,7 +1478,7 @@ const _switchNextCmd = () => {
1478
1478
command .value = ' ' ;
1479
1479
}
1480
1480
_resetCursorPos ()
1481
- store .setIdx (getName (), cmdIdx )
1481
+ getStore () .setIdx (getName (), cmdIdx )
1482
1482
_searchCmd ()
1483
1483
_jumpToBottom (true )
1484
1484
}
0 commit comments