Skip to content

Exposing more props #2

Description

@frantic0

Hi @jcfisher007 (@FormBucketSupport)

nice work at extracting CodeMirror from REPL, very useful.

I'm looking at converting a vanilla js app that uses CM into svelte. I skimmed through CodeMirror.svelte and I was trying to understand what features I would need to add/expose to build this use case.

editor1 = CodeMirror(document.getElementById("editor1"), {
		theme: "abcdef",
		value: defaultEditorCode,
		lineNumbers: true,
		mode:  "javascript",
		lineWrapping: true,
		matchBrackets: true, 
		extraKeys: {
			[ "Cmd-Enter" ]: () => play(),
                         ["Shift-Enter"]: () => evalExpression(),
			["Cmd-."]: () => stop(),
		}
});
editor1.setSize("100%", "100%");
editor1.setOption("vimMode", false);

Currently only these props are exposed

export let readonly = false;
export let errorLoc = null;
export let flex = false;
export let lineNumbers = true;
export let tab = true; 

I guess it's just a matter of exposing more props and bind the logic, correct?

Thanks,
F

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions