@@ -53,7 +53,6 @@ class ConsoleInput extends React.Component {
53
53
return false ;
54
54
}
55
55
56
- // also need to set cursor position
57
56
this . setState ( ( state ) => {
58
57
const newCursor = Math . min (
59
58
state . commandCursor + 1 ,
@@ -63,8 +62,7 @@ class ConsoleInput extends React.Component {
63
62
. getDoc ( )
64
63
. setValue ( state . commandHistory [ newCursor ] || '' ) ;
65
64
const cursorPos = this . _cm . getDoc ( ) . getLine ( 0 ) . length - 1 ;
66
- console . log ( cursorPos ) ;
67
- this . _cm . setCursor ( { line : 0 , ch : cursorPos } ) ;
65
+ this . _cm . getDoc ( ) . setCursor ( { line : 0 , ch : cursorPos } ) ;
68
66
return { commandCursor : newCursor } ;
69
67
} ) ;
70
68
} else if ( e . key === 'ArrowDown' ) {
@@ -74,7 +72,6 @@ class ConsoleInput extends React.Component {
74
72
return false ;
75
73
}
76
74
77
- // also need to set cursor position
78
75
this . setState ( ( state ) => {
79
76
const newCursor = Math . max ( state . commandCursor - 1 , - 1 ) ;
80
77
this . _cm
@@ -83,7 +80,7 @@ class ConsoleInput extends React.Component {
83
80
const newLineCount = this . _cm . getValue ( ) . split ( '\n' ) . length ;
84
81
const newLine = this . _cm . getDoc ( ) . getLine ( newLineCount ) ;
85
82
const cursorPos = newLine ? newLine . length - 1 : 1 ;
86
- this . _cm . setCursor ( { line : lineCount , ch : cursorPos } ) ;
83
+ this . _cm . getDoc ( ) . setCursor ( { line : lineCount , ch : cursorPos } ) ;
87
84
return { commandCursor : newCursor } ;
88
85
} ) ;
89
86
}
@@ -108,12 +105,15 @@ class ConsoleInput extends React.Component {
108
105
< div
109
106
className = "console__input"
110
107
>
111
- < div className = "console-active__arrow-container" >
108
+ < div
109
+ className = "console-active__arrow-container"
110
+ style = { { height : `${ this . props . fontSize * 1.3333 } px` } }
111
+ >
112
112
< RightArrowIcon
113
113
className = "console-active__arrow"
114
114
focusable = "false"
115
115
aria-hidden = "true"
116
- style = { { width : `${ this . props . fontSize } px` } }
116
+ style = { { width : `${ this . props . fontSize } px` , height : ` ${ this . props . fontSize * 0.57 } px` } }
117
117
/>
118
118
</ div >
119
119
< div ref = { ( element ) => { this . codemirrorContainer = element ; } } className = "console__editor" />
0 commit comments