File tree 2 files changed +7
-9
lines changed
editor/src/components/editor
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -92,15 +92,15 @@ export const CommandFunctions = Extension.create({
92
92
method : "POST" ,
93
93
body : JSON . stringify ( { prompt : prompt } ) ,
94
94
} )
95
+ let selection = editor . state . selection ;
95
96
96
97
await response . body ?. pipeThrough ( new TextDecoderStream ( ) ) . pipeTo ( new WritableStream ( {
97
98
write : ( chunk ) => {
98
- const pos = actionExecutor . position ( editor . state . selection ) ;
99
+ const pos = actionExecutor . position ( selection ) ;
99
100
editor . chain ( ) . focus ( ) . insertContentAt ( pos , chunk ) . run ( ) ;
100
101
}
101
102
} ) ) ;
102
103
103
-
104
104
editor . setEditable ( true ) ;
105
105
if ( action . changeForm == ChangeForm . DIFF ) {
106
106
// @ts -ignore
Original file line number Diff line number Diff line change @@ -94,15 +94,13 @@ const LiveEditor = () => {
94
94
< div className = { 'editor-main' } >
95
95
{ editor && < MenuBar editor = { editor } /> }
96
96
< EditorContent editor = { editor } />
97
- { editor && < MenuBubble editor = { editor } /> }
97
+ < div > { editor && < MenuBubble editor = { editor } /> } </ div >
98
98
99
99
{ editor && < div className = "character-count" >
100
- < span > { Math . abs ( editor . state . selection . $from . pos - editor . state . selection . $to . pos ) } selected</ span >
101
-
102
- < span > { editor . storage . characterCount . characters ( ) } characters</ span >
103
-
104
- < span > { editor . storage . characterCount . words ( ) } words</ span >
105
- </ div > }
100
+ < p className = { 'p2' } > { editor . storage . characterCount . characters ( ) } characters</ p >
101
+ < p className = { 'p2' } > { editor . storage . characterCount . words ( ) } words</ p >
102
+ </ div >
103
+ }
106
104
</ div >
107
105
</ div >
108
106
{ editor && < AdviceView editor = { editor } /> }
You can’t perform that action at this time.
0 commit comments