joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.26k stars 142 forks source link

fix bug separating multiple values when printing #590

Open bo-tato opened 1 year ago

bo-tato commented 1 year ago

slynk-pprint-values forgets to pass the stream to terpri when it prints a newline between values, so when you eval in emacs for example (parse-integer "243") it shows as 2433, with this fix it will print correctly:

243
3
joaotavora commented 1 year ago

so when you eval in emacs for example (parse-integer "243")

What method of evaluation are you using? REPL? C-x C-e? I can't reproduce this.

bo-tato commented 1 year ago

ah true, I got it using the eval in overlay code from https://github.com/joaotavora/sly/issues/567 which is running (sly-eval `(slynk:pprint-eval ,(sly-sexp-at-point))) that overlay code has I think a few edge cases where it doesn't display things right, but unless I'm missing something this one isn't the fault of my sly-eval-sexp-overlay. It seems C-x C-e doesn't call slynk-pprint-values. Without the patch slynk-pprint-values returns the string "2433", after the patch it returns the string:

243
3

with the newline as I think is intended