question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sublime demo is not working

See original GitHub issue

I copied all code from demo/sublime.html but its not working on my localhost. However basic demo is working.

Here is my code-

                       <link rel="stylesheet" href="aryan/assets/codemirror/codemirror.css">
                        <link rel="stylesheet" href="aryan/assets/codemirror/foldgutter.css">
                        <link rel="stylesheet" href="aryan/assets/codemirror/dialog.css">
                        <link rel="stylesheet" href="aryan/assets/codemirror/monokai.css">
                        <script src="aryan/assets/codemirror/codemirror.js"></script>
                        <script src="aryan/assets/codemirror/searchcursor.js"></script>
                        <script src="aryan/assets/codemirror/search.js"></script>
                        <script src="aryan/assets/codemirror/dialog.js"></script>
                        <script src="aryan/assets/codemirror/matchbrackets.js"></script>
                        <script src="aryan/assets/codemirror/closebrackets.js"></script>
                        <script src="aryan/assets/codemirror/comment.js"></script>
                        <script src="aryan/assets/codemirror/hardwrap.js"></script>
                        <script src="aryan/assets/codemirror/foldcode.js"></script>
                        <script src="aryan/assets/codemirror/brace-fold.js"></script>
                        <script src="aryan/assets/codemirror/javascript.js"></script>
                        <script src="aryan/assets/codemirror/sublime.js"></script>
                      <script type="text/javascript">
                     var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
                          lineNumbers: true,
                          //mode: "text/html",
                          matchBrackets: true
                        });
                      // var value = "// The bindings defined specifically in the Sublime Text mode\nvar bindings = {\n";
                      // var map = CodeMirror.keyMap.sublime;
                      // for (var key in map) {
                      //   var val = map[key];
                      //   if (key != "fallthrough" && val != "..." && (!/find/.test(val) || /findUnder/.test(val)))
                      //     value += "  \"" + key + "\": \"" + val + "\",\n";
                      // }
                      // value += "}\n\n// The implementation of joinLines\n";
                      // value += CodeMirror.commands.joinLines.toString().replace(/^function\s*\(/, "function joinLines(").replace(/\n  /g, "\n") + "\n";
                      // var editor = CodeMirror(document.getElementById("editor"), {
                      //   value: value,
                      //   lineNumbers: true,
                      //   mode: "javascript",
                      //   keyMap: "sublime",
                      //   autoCloseBrackets: true,
                      //   matchBrackets: true,
                      //   showCursorWhenSelecting: true,
                      //   theme: "monokai",
                      //   tabSize: 2
                      // });
                    </script>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vincentwoocommented, Apr 4, 2016

You just randomly pasted some stuff in a fiddle. You need to actually include JS libraries, etc. I recommend you learn basic HTML/JS before attempting to use a third party library like CodeMirror.

0reactions
matthias-vogtcommented, Apr 4, 2016

The jsfiddle just has an SSL issue, except for that it works. You included codemirror.css over http:// on jsfiddle, which uses https. Use // or https:// instead and you’ll be fine. https://jsfiddle.net/mj8Lh59n/8/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sublime demo is not working · Issue #3930 - GitHub
I copied all code from demo/sublime.html but its not working on my localhost. However basic demo is working. Here is my code-
Read more >
So, what's stopping me from using the evaluation version and ...
While Sublime is in the unregistered evaluation mode, you get nag popups after every few saves to remind you that you haven't paid...
Read more >
Learn How to Use Sublime Text: A Quick Overview - Kinsta
To run code in Sublime Text, go to Tools > Build System, and select the language for your code (Sublime comes with support...
Read more >
Sublime Text bindings demo - CodeMirror
Enable the keymap by loading keymap/sublime.js and setting the keyMap option to "sublime " . (A lot of the search functionality is still...
Read more >
Chromium Docs - Using Sublime Text as your IDE - Google Git
Check out some visual demos for a quick demonstration. You can download and install Sublime Text 3 from ... Linux; Mac (not working);...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found