@@ -131,13 +131,6 @@ function updateEditor(view, text, pos) {
131131 } )
132132}
133133
134- function splitResult ( s ) {
135- if ( s . length > 100 ) {
136- return "\n" + s . substring ( 0 , 100 ) + "..." + s . substring ( s . length - 2 )
137- }
138- return s
139- }
140-
141134function tryEval ( ctx , s ) {
142135 try {
143136 return evalString ( ctx , s )
@@ -153,7 +146,7 @@ function evalAtCursor(view) {
153146 posBeforeEval = view . state . selection . main . head
154147 const codeBeforeCursor = codeBeforeEval . slice ( 0 , posBeforeEval )
155148 const codeAfterCursor = codeBeforeEval . slice ( posBeforeEval , codeBeforeEval . length )
156- evalResult = splitResult ( tryEval ( ctx , cursorNodeString ( view . state ) ) )
149+ evalResult = tryEval ( ctx , cursorNodeString ( view . state ) )
157150 const codeWithResult = codeBeforeCursor + " => " + evalResult + " " + codeAfterCursor
158151 updateEditor ( view , codeWithResult , posBeforeEval )
159152 view . dispatch ( { selection : { anchor : posBeforeEval , head : posBeforeEval } } )
@@ -174,15 +167,15 @@ function evalTopLevel(view) {
174167 codeBeforeEval = doc
175168 const codeBeforeFormEnd = codeBeforeEval . slice ( 0 , posAtFormEnd )
176169 const codeAfterFormEnd = codeBeforeEval . slice ( posAtFormEnd , codeBeforeEval . length )
177- evalResult = splitResult ( tryEval ( ctx , topLevelString ( view . state ) ) )
170+ evalResult = tryEval ( ctx , topLevelString ( view . state ) )
178171 const codeWithResult = codeBeforeFormEnd + " => " + evalResult + " " + codeAfterFormEnd
179172 updateEditor ( view , codeWithResult , posBeforeEval )
180173 return true
181174}
182175
183176function evalCell ( view ) {
184177 const doc = view . state . doc . toString ( )
185- evalResult = splitResult ( tryEval ( ctx , view . state . doc . text . join ( " " ) ) )
178+ evalResult = tryEval ( ctx , view . state . doc . text . join ( " " ) )
186179 const codeWithResult = doc + "\n" + " => " + evalResult
187180 updateEditor ( view , codeWithResult , posBeforeEval )
188181 //console.log("evalCell>", evalString(ctx, view.state.doc.text.join(" ")))
0 commit comments