         @source_editor?.focus()
 
 
-    insert_link: () =>
+    insert_link: (cm) =>
         dialog = templates.find(".salvus-html-editor-link-dialog").clone()
         dialog.modal('show')
         dialog.find(".btn-close").off('click').click () ->

                else
                    s = "\\url{#{url}}"

            cm = @cm()
            selections = cm.listSelections()
            selections.reverse()
            for sel in selections


        @init_preview_select()

        @init_keybindings()

        # this is entirely because of the chat
        # currently being part of @source_editor, and
        # only calling the show for that; once chat
