rksm / paredit.js

Generic reader and editor for s-expressions.
MIT License
107 stars 21 forks source link

paredit.indentRange(...) now crashes #10

Closed sjlevine closed 8 years ago

sjlevine commented 8 years ago

Sorry to bother you again Robert! It appears there may be a bug in the latest update to paredit. Namely, I get an error at line 465 in editor.js (which seems to have been changed recenetly). This can be reproduced with the following code:

src = '(defun foo (x)\n  (* x x))\n\n';     // src.length == 27
ast = paredit.parse(src);
paredit.editor.indentRange(ast, src, 0, 26);

The last line crashes in version 0.2.12 in paredit.js, but not in version 0.2.11. I found this glitch through it's use in the lisp-paredit and the atom-slime Atom text editor packages, which automatically indent code but now report errors.

Thanks for your help and continued support on this great package! It is super useful!

rksm commented 8 years ago

Sorry for that, looking into it right now...

sjlevine commented 8 years ago

Wow, impressive turnaround time! Your change does indeed fix the issue. Thanks!