0

LightTable has code folding since v0.6.1, it's key binding is C-= by default. It works for Python files out of the box, but it does nothing with Clojure files. The Codemirror code sets fold to "indent" at https://github.com/LightTable/Python/blob/master/codemirror/python.js#L351. My question is how can I add code folding to a file type that's not handled by Codemirror by default. I'd like to do it without having to touch a js file, hopefully writing only a little ClojureScript in my user settings.

Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83

1 Answers1

0

Unfortunately folding needs a folding helper function that will starting from a given position seek the start and end position for the fold. These currently exist for languages that use braces (like java, c++) or indentation (python). So, unless someone writes a helper function that can parse s-expressions and find where to fold them, folding in clojure will not work.

Felix Benner
  • 268
  • 1
  • 7
  • Indeed. Perhaps something as http://www.emacswiki.org/emacs/HideShow can serve to inspire. It would be welcome at least. – Rob Jens Dec 17 '14 at 20:57