From 99f904adcc37d93c90defcd8ce898598e25be212 Mon Sep 17 00:00:00 2001
From: Hugues Hiegel
Date: Wed, 11 Mar 2015 16:55:04 +0100
Subject: Lot of plugins
---
.../lib/CodeMirror-2.3/demo/activeline.html | 72 ++++++++++
.../lib/CodeMirror-2.3/demo/changemode.html | 50 +++++++
.../lib/CodeMirror-2.3/demo/closetag.html | 65 +++++++++
.../lib/CodeMirror-2.3/demo/complete.html | 70 ++++++++++
codemirror_ui/lib/CodeMirror-2.3/demo/emacs.html | 59 ++++++++
codemirror_ui/lib/CodeMirror-2.3/demo/folding.html | 61 +++++++++
.../lib/CodeMirror-2.3/demo/formatting.html | 80 +++++++++++
.../lib/CodeMirror-2.3/demo/fullscreen.html | 152 +++++++++++++++++++++
.../lib/CodeMirror-2.3/demo/loadmode.html | 39 ++++++
codemirror_ui/lib/CodeMirror-2.3/demo/marker.html | 52 +++++++
.../lib/CodeMirror-2.3/demo/matchhighlighter.html | 37 +++++
.../lib/CodeMirror-2.3/demo/multiplex.html | 59 ++++++++
.../lib/CodeMirror-2.3/demo/mustache.html | 57 ++++++++
codemirror_ui/lib/CodeMirror-2.3/demo/preview.html | 76 +++++++++++
codemirror_ui/lib/CodeMirror-2.3/demo/resize.html | 41 ++++++
codemirror_ui/lib/CodeMirror-2.3/demo/runmode.html | 49 +++++++
codemirror_ui/lib/CodeMirror-2.3/demo/search.html | 83 +++++++++++
codemirror_ui/lib/CodeMirror-2.3/demo/theme.html | 78 +++++++++++
codemirror_ui/lib/CodeMirror-2.3/demo/vim.html | 50 +++++++
.../lib/CodeMirror-2.3/demo/visibletabs.html | 61 +++++++++
20 files changed, 1291 insertions(+)
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/activeline.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/changemode.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/closetag.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/complete.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/emacs.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/folding.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/formatting.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/fullscreen.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/loadmode.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/marker.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/matchhighlighter.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/multiplex.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/mustache.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/preview.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/resize.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/runmode.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/search.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/theme.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/vim.html
create mode 100644 codemirror_ui/lib/CodeMirror-2.3/demo/visibletabs.html
(limited to 'codemirror_ui/lib/CodeMirror-2.3/demo')
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/activeline.html b/codemirror_ui/lib/CodeMirror-2.3/demo/activeline.html
new file mode 100644
index 0000000..a5b3c2c
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/activeline.html
@@ -0,0 +1,72 @@
+
+
+
+ CodeMirror: Active Line Demo
+
+
+
+
+
+
+
+
+ CodeMirror: Active Line Demo
+
+
+
+
+
+ Styling the current cursor line.
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/changemode.html b/codemirror_ui/lib/CodeMirror-2.3/demo/changemode.html
new file mode 100644
index 0000000..f5e0661
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/changemode.html
@@ -0,0 +1,50 @@
+
+
+
+ CodeMirror: Mode-Changing Demo
+
+
+
+
+
+
+
+
+
+ CodeMirror: Mode-Changing demo
+
+
+;; If there is Scheme code in here, the editor will be in Scheme mode.
+;; If you put in JS instead, it'll switch to JS mode.
+
+(define (double x)
+ (* x x))
+
+
+On changes to the content of the above editor, a (crude) script
+tries to auto-detect the language used, and switches the editor to
+either JavaScript or Scheme mode based on that.
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/closetag.html b/codemirror_ui/lib/CodeMirror-2.3/demo/closetag.html
new file mode 100644
index 0000000..57cd4be
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/closetag.html
@@ -0,0 +1,65 @@
+
+
+
+ CodeMirror: Close-Tag Demo
+
+
+
+
+
+
+
+
+
+
+
+
+ Close-Tag Demo
+
+ Type an html tag. When you type '>' or '/', the tag will auto-close/complete. Block-level tags will indent.
+ There are options for disabling tag closing or customizing the list of tags to indent.
+ Works with "text/html" (based on htmlmixed.js or xml.js) mode.
+ View source for key binding details.
+
+
+
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/complete.html b/codemirror_ui/lib/CodeMirror-2.3/demo/complete.html
new file mode 100644
index 0000000..95ae397
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/complete.html
@@ -0,0 +1,70 @@
+
+
+
+ CodeMirror: Autocomplete Demo
+
+
+
+
+
+
+
+
+
+
+ CodeMirror: Autocomplete demo
+
+
+function getCompletions(token, context) {
+ var found = [], start = token.string;
+ function maybeAdd(str) {
+ if (str.indexOf(start) == 0) found.push(str);
+ }
+ function gatherCompletions(obj) {
+ if (typeof obj == "string") forEach(stringProps, maybeAdd);
+ else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
+ else if (obj instanceof Function) forEach(funcProps, maybeAdd);
+ for (var name in obj) maybeAdd(name);
+ }
+
+ if (context) {
+ // If this is a property, see if it belongs to some object we can
+ // find in the current environment.
+ var obj = context.pop(), base;
+ if (obj.className == "js-variable")
+ base = window[obj.string];
+ else if (obj.className == "js-string")
+ base = "";
+ else if (obj.className == "js-atom")
+ base = 1;
+ while (base != null && context.length)
+ base = base[context.pop().string];
+ if (base != null) gatherCompletions(base);
+ }
+ else {
+ // If not, just look in the window object and any local scope
+ // (reading into JS mode internals to get at the local variables)
+ for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
+ gatherCompletions(window);
+ forEach(keywords, maybeAdd);
+ }
+ return found;
+}
+
+
+Press ctrl-space to activate autocompletion. See
+the code (here
+and here ) to figure out
+how it works.
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/emacs.html b/codemirror_ui/lib/CodeMirror-2.3/demo/emacs.html
new file mode 100644
index 0000000..87190c5
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/emacs.html
@@ -0,0 +1,59 @@
+
+
+
+ CodeMirror: Emacs bindings demo
+
+
+
+
+
+
+
+
+
+ CodeMirror: Emacs bindings demo
+
+
+#include "syscalls.h"
+/* getchar: simple buffered version */
+int getchar(void)
+{
+ static char buf[BUFSIZ];
+ static char *bufp = buf;
+ static int n = 0;
+ if (n == 0) { /* buffer is empty */
+ n = read(0, buf, sizeof buf);
+ bufp = buf;
+ }
+ return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
+}
+
+
+The emacs keybindings are enabled by
+including keymap/emacs.js and setting
+the keyMap
option to "emacs"
. Because
+CodeMirror's internal API is quite different from Emacs, they are only
+a loose approximation of actual emacs bindings, though.
+
+Also note that a lot of browsers disallow certain keys from being
+captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
+result that idiomatic use of Emacs keys will constantly close your tab
+or open a new window.
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/folding.html b/codemirror_ui/lib/CodeMirror-2.3/demo/folding.html
new file mode 100644
index 0000000..2e05e9b
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/folding.html
@@ -0,0 +1,61 @@
+
+
+
+ CodeMirror: Code Folding Demo
+
+
+
+
+
+
+
+
+
+
+ CodeMirror: Code Folding Demo
+
+ Demonstration of code folding using the code
+ in foldcode.js
.
+ Press ctrl-q or click on the gutter to fold a block, again
+ to unfold.
+
+ JavaScript:
+ HTML:
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/formatting.html b/codemirror_ui/lib/CodeMirror-2.3/demo/formatting.html
new file mode 100644
index 0000000..e4faf5f
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/formatting.html
@@ -0,0 +1,80 @@
+
+
+
+ CodeMirror: Formatting Demo
+
+
+
+
+
+
+
+
+
+
+
+
+ CodeMirror: Formatting demo
+
+
+
+
+
+
+
+Select a piece of code and click one of the links below to apply automatic formatting to the selected text or comment/uncomment the selected text. Note that the formatting behavior depends on the current block's mode.
+
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/fullscreen.html b/codemirror_ui/lib/CodeMirror-2.3/demo/fullscreen.html
new file mode 100644
index 0000000..0e2b5ec
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/fullscreen.html
@@ -0,0 +1,152 @@
+
+
+
+ CodeMirror: Full Screen Editing
+
+
+
+
+
+
+
+
+
+ CodeMirror: Full Screen Editing
+
+
+ indentWithTabs (boolean)
+ Whether, when indenting, the first N*8 spaces should be
+ replaced by N tabs. Default is false.
+
+ tabMode (string)
+ Determines what happens when the user presses the tab key.
+ Must be one of the following:
+
+ "classic" (the default)
+ When nothing is selected, insert a tab. Otherwise,
+ behave like the "shift"
mode. (When shift is
+ held, this behaves like the "indent"
mode.)
+ "shift"
+ Indent all selected lines by
+ one indentUnit
.
+ If shift was held while pressing tab, un-indent all selected
+ lines one unit.
+ "indent"
+ Indent the line the 'correctly', based on its syntactic
+ context. Only works if the
+ mode supports it.
+ "default"
+ Do not capture tab presses, let the browser apply its
+ default behaviour (which usually means it skips to the next
+ control).
+
+
+ enterMode (string)
+ Determines whether and how new lines are indented when the
+ enter key is pressed. The following modes are supported:
+
+ "indent" (the default)
+ Use the mode's indentation rules to give the new line
+ the correct indentation.
+ "keep"
+ Indent the line the same as the previous line.
+ "flat"
+ Do not indent the new line.
+
+
+ enterMode (string)
+ Determines whether and how new lines are indented when the
+ enter key is pressed. The following modes are supported:
+
+ "indent" (the default)
+ Use the mode's indentation rules to give the new line
+ the correct indentation.
+ "keep"
+ Indent the line the same as the previous line.
+ "flat"
+ Do not indent the new line.
+
+
+ enterMode (string)
+ Determines whether and how new lines are indented when the
+ enter key is pressed. The following modes are supported:
+
+ "indent" (the default)
+ Use the mode's indentation rules to give the new line
+ the correct indentation.
+ "keep"
+ Indent the line the same as the previous line.
+ "flat"
+ Do not indent the new line.
+
+
+ enterMode (string)
+ Determines whether and how new lines are indented when the
+ enter key is pressed. The following modes are supported:
+
+ "indent" (the default)
+ Use the mode's indentation rules to give the new line
+ the correct indentation.
+ "keep"
+ Indent the line the same as the previous line.
+ "flat"
+ Do not indent the new line.
+
+
+
+
+
+ Press F11 when cursor is in the editor to toggle full screen editing. Esc can also be used to exit full screen editing.
+
+ Note: Does not currently work correctly in IE
+ 6 and 7, where setting the height of something
+ to 100%
doesn't make it full screen.
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/loadmode.html b/codemirror_ui/lib/CodeMirror-2.3/demo/loadmode.html
new file mode 100644
index 0000000..3d7015e
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/loadmode.html
@@ -0,0 +1,39 @@
+
+
+
+ CodeMirror: Lazy Mode Loading Demo
+
+
+
+
+
+
+
+
+ CodeMirror: Lazy Mode Loading
+
+ This is the editor.
+// It starts out in plain text mode,
+# use the control below to load and apply a mode
+ "you'll see the highlighting of" this text /*change*/.
+
+ change mode
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/marker.html b/codemirror_ui/lib/CodeMirror-2.3/demo/marker.html
new file mode 100644
index 0000000..00a89ce
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/marker.html
@@ -0,0 +1,52 @@
+
+
+
+ CodeMirror: Breakpoint Demo
+
+
+
+
+
+
+
+
+ CodeMirror: Breakpoint demo
+
+
+CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ onGutterClick: function(cm, n) {
+ var info = cm.lineInfo(n);
+ if (info.markerText)
+ cm.clearMarker(n);
+ else
+ cm.setMarker(n, "● %N%");
+ }
+});
+
+
+Click the line-number gutter to add or remove 'breakpoints'.
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/matchhighlighter.html b/codemirror_ui/lib/CodeMirror-2.3/demo/matchhighlighter.html
new file mode 100644
index 0000000..768c51e
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/matchhighlighter.html
@@ -0,0 +1,37 @@
+
+
+
+ CodeMirror: Match Highlighter Demo
+
+
+
+
+
+
+
+
+
+ CodeMirror: Match Highlighter Demo
+
+ Select this text: hardToSpotVar
+ And everywhere else in your code where hardToSpotVar appears will automatically illuminate.
+Give it a try! No more hardToSpotVars.
+
+
+
+ Highlight matches of selected text on select
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/multiplex.html b/codemirror_ui/lib/CodeMirror-2.3/demo/multiplex.html
new file mode 100644
index 0000000..9348545
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/multiplex.html
@@ -0,0 +1,59 @@
+
+
+
+ CodeMirror: Multiplexing Parser Demo
+
+
+
+
+
+
+
+
+
+ CodeMirror: Multiplexing Parser Demo
+
+
+
+
+ << this is not >
+ <<
+ multiline
+ not html
+ at all : &
+ >>
+ this is html again
+
+
+
+
+
+
+ Demonstration of a multiplexing mode, which, at certain
+ boundary strings, switches to one or more inner modes. The out
+ (HTML) mode does not get fed the content of the <<
+ >>
blocks. See
+ the manual and
+ the source for more
+ information.
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/mustache.html b/codemirror_ui/lib/CodeMirror-2.3/demo/mustache.html
new file mode 100644
index 0000000..e96fda8
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/mustache.html
@@ -0,0 +1,57 @@
+
+
+
+ CodeMirror: Overlay Parser Demo
+
+
+
+
+
+
+
+
+
+ CodeMirror: Overlay Parser Demo
+
+
+
+
+ {{title}}
+ These are links to {{things}}:
+
+
+
+
+
+
+
+ Demonstration of a mode that parses HTML, highlighting
+ the Mustache templating
+ directives inside of it by using the code
+ in overlay.js
. View
+ source to see the 15 lines of code needed to accomplish this.
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/preview.html b/codemirror_ui/lib/CodeMirror-2.3/demo/preview.html
new file mode 100644
index 0000000..607a621
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/preview.html
@@ -0,0 +1,76 @@
+
+
+
+ CodeMirror: HTML5 preview
+
+
+
+
+
+
+
+
+
+
+
+ CodeMirror: HTML5 preview
+
+
+
+
+
+ HTML5 canvas demo
+
+
+
+ Canvas pane goes here:
+
+
+
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/resize.html b/codemirror_ui/lib/CodeMirror-2.3/demo/resize.html
new file mode 100644
index 0000000..e20c3fb
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/resize.html
@@ -0,0 +1,41 @@
+
+
+
+ CodeMirror: Autoresize Demo
+
+
+
+
+
+
+
+
+ CodeMirror: Autoresize demo
+
+
+.CodeMirror-scroll {
+ height: auto;
+ overflow-y: hidden;
+ overflow-x: auto;
+}
+
+By setting a few CSS properties, CodeMirror can be made to
+automatically resize to fit its content.
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/runmode.html b/codemirror_ui/lib/CodeMirror-2.3/demo/runmode.html
new file mode 100644
index 0000000..d6ee17e
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/runmode.html
@@ -0,0 +1,49 @@
+
+
+
+ CodeMirror: Mode Runner Demo
+
+
+
+
+
+
+
+ CodeMirror: Mode Runner Demo
+
+
+
+ Enter your xml here and press the button below to display
+ it as highlighted by the CodeMirror XML mode
+
+
+ Highlight!
+
+
+
+
+ Running a CodeMirror mode outside of the editor.
+ The CodeMirror.runMode
function, defined
+ in lib/runmode.js
takes the following arguments:
+
+
+ text (string)
+ The document to run through the highlighter.
+ mode (mode spec )
+ The mode to use (must be loaded as normal).
+ output (function or DOM node)
+ If this is a function, it will be called for each token with
+ two arguments, the token's text and the token's style class (may
+ be null
for unstyled tokens). If it is a DOM node,
+ the tokens will be converted to span
elements as in
+ an editor, and inserted into the node
+ (through innerHTML
).
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/search.html b/codemirror_ui/lib/CodeMirror-2.3/demo/search.html
new file mode 100644
index 0000000..c385e6b
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/search.html
@@ -0,0 +1,83 @@
+
+
+
+ CodeMirror: Search/Replace Demo
+
+
+
+
+
+
+
+
+
+
+
+
+ CodeMirror: Search/Replace Demo
+
+
+ indentWithTabs (boolean)
+ Whether, when indenting, the first N*8 spaces should be
+ replaced by N tabs. Default is false.
+
+ tabMode (string)
+ Determines what happens when the user presses the tab key.
+ Must be one of the following:
+
+ "classic" (the default)
+ When nothing is selected, insert a tab. Otherwise,
+ behave like the "shift"
mode. (When shift is
+ held, this behaves like the "indent"
mode.)
+ "shift"
+ Indent all selected lines by
+ one indentUnit
.
+ If shift was held while pressing tab, un-indent all selected
+ lines one unit.
+ "indent"
+ Indent the line the 'correctly', based on its syntactic
+ context. Only works if the
+ mode supports it.
+ "default"
+ Do not capture tab presses, let the browser apply its
+ default behaviour (which usually means it skips to the next
+ control).
+
+
+ enterMode (string)
+ Determines whether and how new lines are indented when the
+ enter key is pressed. The following modes are supported:
+
+ "indent" (the default)
+ Use the mode's indentation rules to give the new line
+ the correct indentation.
+ "keep"
+ Indent the line the same as the previous line.
+ "flat"
+ Do not indent the new line.
+
+
+
+
+
+ Demonstration of primitive search/replace functionality. The
+ keybindings (which can be overridden by custom keymaps) are:
+
+ Ctrl-F / Cmd-F Start searching
+ Ctrl-G / Cmd-G Find next
+ Shift-Ctrl-G / Shift-Cmd-G Find previous
+ Shift-Ctrl-F / Cmd-Option-F Replace
+ Shift-Ctrl-R / Shift-Cmd-Option-F Replace all
+
+ Searching is enabled by
+ including lib/util/search.js .
+ For good-looking input dialogs, you also want to include
+ lib/util/dialog.js
+ and lib/util/dialog.css .
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/theme.html b/codemirror_ui/lib/CodeMirror-2.3/demo/theme.html
new file mode 100644
index 0000000..ac47d91
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/theme.html
@@ -0,0 +1,78 @@
+
+
+
+ CodeMirror: Theme Demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CodeMirror: Theme demo
+
+
+function findSequence(goal) {
+ function find(start, history) {
+ if (start == goal)
+ return history;
+ else if (start > goal)
+ return null;
+ else
+ return find(start + 5, "(" + history + " + 5)") ||
+ find(start * 3, "(" + history + " * 3)");
+ }
+ return find(1, "1");
+}
+
+Select a theme:
+ default
+ ambiance
+ blackboard
+ cobalt
+ eclipse
+ elegant
+ erlang-dark
+ lesser-dark
+ monokai
+ neat
+ night
+ rubyblue
+ vibrant-ink
+ xq-dark
+
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/vim.html b/codemirror_ui/lib/CodeMirror-2.3/demo/vim.html
new file mode 100644
index 0000000..76ad6da
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/vim.html
@@ -0,0 +1,50 @@
+
+
+
+ CodeMirror: Vim bindings demo
+
+
+
+
+
+
+
+
+
+ CodeMirror: Vim bindings demo
+
+
+#include "syscalls.h"
+/* getchar: simple buffered version */
+int getchar(void)
+{
+ static char buf[BUFSIZ];
+ static char *bufp = buf;
+ static int n = 0;
+ if (n == 0) { /* buffer is empty */
+ n = read(0, buf, sizeof buf);
+ bufp = buf;
+ }
+ return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
+}
+
+
+The vim keybindings are enabled by
+including keymap/vim.js and setting
+the keyMap
option to "vim"
. Because
+CodeMirror's internal API is quite different from Vim, they are only
+a loose approximation of actual vim bindings, though.
+
+
+
+
+
diff --git a/codemirror_ui/lib/CodeMirror-2.3/demo/visibletabs.html b/codemirror_ui/lib/CodeMirror-2.3/demo/visibletabs.html
new file mode 100644
index 0000000..96d1ea5
--- /dev/null
+++ b/codemirror_ui/lib/CodeMirror-2.3/demo/visibletabs.html
@@ -0,0 +1,61 @@
+
+
+
+ CodeMirror: Visible tabs demo
+
+
+
+
+
+
+
+
+ CodeMirror: Visible tabs demo
+
+
+#include "syscalls.h"
+/* getchar: simple buffered version */
+int getchar(void)
+{
+ static char buf[BUFSIZ];
+ static char *bufp = buf;
+ static int n = 0;
+ if (n == 0) { /* buffer is empty */
+ n = read(0, buf, sizeof buf);
+ bufp = buf;
+ }
+ return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
+}
+
+
+Tabs inside the editor are spans with the
+class cm-tab
, and can be styled. This demo uses
+an :after
pseudo-class CSS hack that will not work on old
+browsers. You can use a more conservative technique like a background
+image as an alternative.
+
+
+
+
+
--
cgit v1.2.3