->cm-ed function

24 views
Skip to first unread message

Abdillah Fa'iz

unread,
Jun 18, 2015, 6:06:21 AM6/18/15
to light-table...@googlegroups.com
It is hard to figure it out from the name, what exactly a function ->cm-ed used for?
I understand that it checks for protocol implementation on the given argument.
But, whats more? What is e, editor object?

Thanks.

Magnus Rundberget

unread,
Jun 18, 2015, 7:33:17 AM6/18/15
to light-table...@googlegroups.com
The function is used to retrieve the codemirror editor object (js obj) from a Light Table editor atom.
Every editor in Lt is an atom (https://github.com/LightTable/LightTable/blob/master/src/lt/objs/editor.cljs#L426), one of its properties is
a reference to the underlying codemirror editor)

You typically use the function when you need to invoke one of the many available codemirror editor related functions directly . For most cases you'd probably use
the provided wrapper functions already available in the lt.objects.editor namespace.

Cheers
Magnus

Abdillah Fa'iz

unread,
Jun 18, 2015, 10:02:56 PM6/18/15
to light-table...@googlegroups.com
Very well, I see now, so the name implied Convert "to CodeMirror-ed" object. Thank you.
Reply all
Reply to author
Forward
0 new messages