@muze-nl/simplystore 0.3.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/package.json~ +33 -0
- package/src/server.mjs +68 -61
- package/www/codemirror/addon/comment/comment.js +0 -211
- package/www/codemirror/addon/comment/continuecomment.js +0 -114
- package/www/codemirror/addon/dialog/dialog.css +0 -32
- package/www/codemirror/addon/dialog/dialog.js +0 -163
- package/www/codemirror/addon/display/autorefresh.js +0 -47
- package/www/codemirror/addon/display/fullscreen.css +0 -6
- package/www/codemirror/addon/display/fullscreen.js +0 -41
- package/www/codemirror/addon/display/panel.js +0 -133
- package/www/codemirror/addon/display/placeholder.js +0 -78
- package/www/codemirror/addon/display/rulers.js +0 -51
- package/www/codemirror/addon/edit/closebrackets.js +0 -201
- package/www/codemirror/addon/edit/closetag.js +0 -185
- package/www/codemirror/addon/edit/continuelist.js +0 -101
- package/www/codemirror/addon/edit/matchbrackets.js +0 -160
- package/www/codemirror/addon/edit/matchtags.js +0 -66
- package/www/codemirror/addon/edit/trailingspace.js +0 -27
- package/www/codemirror/addon/fold/brace-fold.js +0 -119
- package/www/codemirror/addon/fold/comment-fold.js +0 -59
- package/www/codemirror/addon/fold/foldcode.js +0 -159
- package/www/codemirror/addon/fold/foldgutter.css +0 -20
- package/www/codemirror/addon/fold/foldgutter.js +0 -169
- package/www/codemirror/addon/fold/indent-fold.js +0 -48
- package/www/codemirror/addon/fold/markdown-fold.js +0 -49
- package/www/codemirror/addon/fold/xml-fold.js +0 -184
- package/www/codemirror/addon/hint/anyword-hint.js +0 -41
- package/www/codemirror/addon/hint/css-hint.js +0 -66
- package/www/codemirror/addon/hint/html-hint.js +0 -351
- package/www/codemirror/addon/hint/javascript-hint.js +0 -162
- package/www/codemirror/addon/hint/show-hint.css +0 -37
- package/www/codemirror/addon/hint/show-hint.js +0 -523
- package/www/codemirror/addon/hint/sql-hint.js +0 -304
- package/www/codemirror/addon/hint/xml-hint.js +0 -132
- package/www/codemirror/addon/lint/coffeescript-lint.js +0 -47
- package/www/codemirror/addon/lint/css-lint.js +0 -40
- package/www/codemirror/addon/lint/html-lint.js +0 -59
- package/www/codemirror/addon/lint/json-lint.js +0 -40
- package/www/codemirror/addon/lint/yaml-lint.js +0 -41
- package/www/codemirror/addon/merge/merge.css +0 -119
- package/www/codemirror/addon/merge/merge.js +0 -1018
- package/www/codemirror/addon/mode/loadmode.js +0 -66
- package/www/codemirror/addon/mode/multiplex.js +0 -136
- package/www/codemirror/addon/mode/multiplex_test.js +0 -49
- package/www/codemirror/addon/mode/overlay.js +0 -90
- package/www/codemirror/addon/mode/simple.js +0 -216
- package/www/codemirror/addon/runmode/colorize.js +0 -40
- package/www/codemirror/addon/runmode/runmode-standalone.js +0 -334
- package/www/codemirror/addon/runmode/runmode.js +0 -76
- package/www/codemirror/addon/runmode/runmode.node.js +0 -329
- package/www/codemirror/addon/scroll/annotatescrollbar.js +0 -128
- package/www/codemirror/addon/scroll/scrollpastend.js +0 -48
- package/www/codemirror/addon/scroll/simplescrollbars.css +0 -66
- package/www/codemirror/addon/scroll/simplescrollbars.js +0 -152
- package/www/codemirror/addon/search/jump-to-line.js +0 -53
- package/www/codemirror/addon/search/match-highlighter.js +0 -167
- package/www/codemirror/addon/search/matchesonscrollbar.css +0 -8
- package/www/codemirror/addon/search/matchesonscrollbar.js +0 -97
- package/www/codemirror/addon/search/search.js +0 -295
- package/www/codemirror/addon/search/searchcursor.js +0 -305
- package/www/codemirror/addon/selection/active-line.js +0 -72
- package/www/codemirror/addon/selection/mark-selection.js +0 -119
- package/www/codemirror/addon/selection/selection-pointer.js +0 -98
- package/www/codemirror/addon/tern/tern.css +0 -87
- package/www/codemirror/addon/tern/tern.js +0 -756
- package/www/codemirror/addon/tern/worker.js +0 -44
- package/www/codemirror/addon/wrap/hardwrap.js +0 -160
- package/www/codemirror/bin/source-highlight +0 -48
- package/www/codemirror/keymap/emacs.js +0 -545
- package/www/codemirror/keymap/sublime.js +0 -720
- package/www/codemirror/keymap/vim.js +0 -5978
- package/www/codemirror/mode/apl/apl.js +0 -174
- package/www/codemirror/mode/asciiarmor/asciiarmor.js +0 -74
- package/www/codemirror/mode/asn.1/asn.1.js +0 -204
- package/www/codemirror/mode/asterisk/asterisk.js +0 -220
- package/www/codemirror/mode/brainfuck/brainfuck.js +0 -85
- package/www/codemirror/mode/clike/clike.js +0 -940
- package/www/codemirror/mode/clojure/clojure.js +0 -292
- package/www/codemirror/mode/cmake/cmake.js +0 -97
- package/www/codemirror/mode/cobol/cobol.js +0 -255
- package/www/codemirror/mode/coffeescript/coffeescript.js +0 -359
- package/www/codemirror/mode/commonlisp/commonlisp.js +0 -125
- package/www/codemirror/mode/crystal/crystal.js +0 -433
- package/www/codemirror/mode/css/css.js +0 -862
- package/www/codemirror/mode/cypher/cypher.js +0 -152
- package/www/codemirror/mode/d/d.js +0 -223
- package/www/codemirror/mode/dart/dart.js +0 -166
- package/www/codemirror/mode/diff/diff.js +0 -47
- package/www/codemirror/mode/django/django.js +0 -356
- package/www/codemirror/mode/dockerfile/dockerfile.js +0 -211
- package/www/codemirror/mode/dtd/dtd.js +0 -142
- package/www/codemirror/mode/dylan/dylan.js +0 -352
- package/www/codemirror/mode/ebnf/ebnf.js +0 -195
- package/www/codemirror/mode/ecl/ecl.js +0 -206
- package/www/codemirror/mode/eiffel/eiffel.js +0 -160
- package/www/codemirror/mode/elm/elm.js +0 -245
- package/www/codemirror/mode/erlang/erlang.js +0 -619
- package/www/codemirror/mode/factor/factor.js +0 -85
- package/www/codemirror/mode/fcl/fcl.js +0 -173
- package/www/codemirror/mode/forth/forth.js +0 -180
- package/www/codemirror/mode/fortran/fortran.js +0 -188
- package/www/codemirror/mode/gas/gas.js +0 -353
- package/www/codemirror/mode/gfm/gfm.js +0 -129
- package/www/codemirror/mode/gherkin/gherkin.js +0 -178
- package/www/codemirror/mode/go/go.js +0 -187
- package/www/codemirror/mode/groovy/groovy.js +0 -247
- package/www/codemirror/mode/haml/haml.js +0 -161
- package/www/codemirror/mode/handlebars/handlebars.js +0 -70
- package/www/codemirror/mode/haskell/haskell.js +0 -268
- package/www/codemirror/mode/haskell-literate/haskell-literate.js +0 -43
- package/www/codemirror/mode/haxe/haxe.js +0 -515
- package/www/codemirror/mode/htmlembedded/htmlembedded.js +0 -37
- package/www/codemirror/mode/htmlmixed/htmlmixed.js +0 -153
- package/www/codemirror/mode/http/http.js +0 -113
- package/www/codemirror/mode/idl/idl.js +0 -290
- package/www/codemirror/mode/jinja2/jinja2.js +0 -193
- package/www/codemirror/mode/jsx/jsx.js +0 -148
- package/www/codemirror/mode/julia/julia.js +0 -390
- package/www/codemirror/mode/livescript/livescript.js +0 -280
- package/www/codemirror/mode/lua/lua.js +0 -160
- package/www/codemirror/mode/markdown/markdown.js +0 -886
- package/www/codemirror/mode/mathematica/mathematica.js +0 -176
- package/www/codemirror/mode/mbox/mbox.js +0 -129
- package/www/codemirror/mode/meta.js +0 -221
- package/www/codemirror/mode/mirc/mirc.js +0 -193
- package/www/codemirror/mode/mllike/mllike.js +0 -359
- package/www/codemirror/mode/modelica/modelica.js +0 -245
- package/www/codemirror/mode/mscgen/mscgen.js +0 -175
- package/www/codemirror/mode/mumps/mumps.js +0 -148
- package/www/codemirror/mode/nginx/nginx.js +0 -178
- package/www/codemirror/mode/nsis/nsis.js +0 -95
- package/www/codemirror/mode/ntriples/ntriples.js +0 -195
- package/www/codemirror/mode/octave/octave.js +0 -139
- package/www/codemirror/mode/oz/oz.js +0 -252
- package/www/codemirror/mode/pascal/pascal.js +0 -136
- package/www/codemirror/mode/pegjs/pegjs.js +0 -111
- package/www/codemirror/mode/perl/perl.js +0 -836
- package/www/codemirror/mode/php/php.js +0 -234
- package/www/codemirror/mode/pig/pig.js +0 -178
- package/www/codemirror/mode/powershell/powershell.js +0 -398
- package/www/codemirror/mode/properties/properties.js +0 -78
- package/www/codemirror/mode/protobuf/protobuf.js +0 -72
- package/www/codemirror/mode/pug/pug.js +0 -591
- package/www/codemirror/mode/puppet/puppet.js +0 -220
- package/www/codemirror/mode/python/python.js +0 -402
- package/www/codemirror/mode/q/q.js +0 -139
- package/www/codemirror/mode/r/r.js +0 -190
- package/www/codemirror/mode/rpm/changes/index.html +0 -66
- package/www/codemirror/mode/rpm/rpm.js +0 -109
- package/www/codemirror/mode/rst/rst.js +0 -557
- package/www/codemirror/mode/ruby/ruby.js +0 -303
- package/www/codemirror/mode/rust/rust.js +0 -72
- package/www/codemirror/mode/sas/sas.js +0 -303
- package/www/codemirror/mode/sass/sass.js +0 -459
- package/www/codemirror/mode/scheme/scheme.js +0 -284
- package/www/codemirror/mode/shell/shell.js +0 -168
- package/www/codemirror/mode/sieve/sieve.js +0 -193
- package/www/codemirror/mode/slim/slim.js +0 -575
- package/www/codemirror/mode/smalltalk/smalltalk.js +0 -168
- package/www/codemirror/mode/smarty/smarty.js +0 -225
- package/www/codemirror/mode/solr/solr.js +0 -104
- package/www/codemirror/mode/soy/soy.js +0 -665
- package/www/codemirror/mode/sparql/sparql.js +0 -184
- package/www/codemirror/mode/spreadsheet/spreadsheet.js +0 -112
- package/www/codemirror/mode/sql/sql.js +0 -525
- package/www/codemirror/mode/stex/stex.js +0 -264
- package/www/codemirror/mode/stylus/stylus.js +0 -775
- package/www/codemirror/mode/swift/swift.js +0 -221
- package/www/codemirror/mode/tcl/tcl.js +0 -140
- package/www/codemirror/mode/textile/textile.js +0 -469
- package/www/codemirror/mode/tiddlywiki/tiddlywiki.css +0 -14
- package/www/codemirror/mode/tiddlywiki/tiddlywiki.js +0 -308
- package/www/codemirror/mode/tiki/tiki.css +0 -26
- package/www/codemirror/mode/tiki/tiki.js +0 -312
- package/www/codemirror/mode/toml/toml.js +0 -88
- package/www/codemirror/mode/tornado/tornado.js +0 -68
- package/www/codemirror/mode/troff/troff.js +0 -84
- package/www/codemirror/mode/ttcn/ttcn.js +0 -283
- package/www/codemirror/mode/ttcn-cfg/ttcn-cfg.js +0 -214
- package/www/codemirror/mode/turtle/turtle.js +0 -162
- package/www/codemirror/mode/twig/twig.js +0 -141
- package/www/codemirror/mode/vb/vb.js +0 -275
- package/www/codemirror/mode/vbscript/vbscript.js +0 -350
- package/www/codemirror/mode/velocity/velocity.js +0 -202
- package/www/codemirror/mode/verilog/verilog.js +0 -781
- package/www/codemirror/mode/vhdl/vhdl.js +0 -189
- package/www/codemirror/mode/vue/vue.js +0 -77
- package/www/codemirror/mode/wast/wast.js +0 -132
- package/www/codemirror/mode/webidl/webidl.js +0 -195
- package/www/codemirror/mode/xml/xml.js +0 -417
- package/www/codemirror/mode/xquery/xquery.js +0 -448
- package/www/codemirror/mode/yacas/yacas.js +0 -204
- package/www/codemirror/mode/yaml/yaml.js +0 -120
- package/www/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +0 -72
- package/www/codemirror/mode/z80/z80.js +0 -116
- package/www/codemirror/rollup.config.js +0 -52
- package/www/codemirror/src/addon/runmode/codemirror-standalone.js +0 -24
- package/www/codemirror/src/addon/runmode/codemirror.node.js +0 -21
- package/www/codemirror/src/addon/runmode/runmode-standalone.js +0 -2
- package/www/codemirror/src/addon/runmode/runmode.node.js +0 -2
- package/www/codemirror/src/codemirror.js +0 -3
- package/www/codemirror/src/display/Display.js +0 -116
- package/www/codemirror/src/display/focus.js +0 -50
- package/www/codemirror/src/display/gutters.js +0 -44
- package/www/codemirror/src/display/highlight_worker.js +0 -55
- package/www/codemirror/src/display/line_numbers.js +0 -48
- package/www/codemirror/src/display/mode_state.js +0 -22
- package/www/codemirror/src/display/operations.js +0 -206
- package/www/codemirror/src/display/scroll_events.js +0 -132
- package/www/codemirror/src/display/scrollbars.js +0 -194
- package/www/codemirror/src/display/scrolling.js +0 -186
- package/www/codemirror/src/display/selection.js +0 -173
- package/www/codemirror/src/display/update_display.js +0 -267
- package/www/codemirror/src/display/update_line.js +0 -189
- package/www/codemirror/src/display/update_lines.js +0 -82
- package/www/codemirror/src/display/view_tracking.js +0 -153
- package/www/codemirror/src/edit/CodeMirror.js +0 -217
- package/www/codemirror/src/edit/commands.js +0 -178
- package/www/codemirror/src/edit/deleteNearSelection.js +0 -30
- package/www/codemirror/src/edit/drop_events.js +0 -130
- package/www/codemirror/src/edit/fromTextArea.js +0 -61
- package/www/codemirror/src/edit/global_events.js +0 -45
- package/www/codemirror/src/edit/key_events.js +0 -163
- package/www/codemirror/src/edit/legacy.js +0 -62
- package/www/codemirror/src/edit/main.js +0 -69
- package/www/codemirror/src/edit/methods.js +0 -555
- package/www/codemirror/src/edit/mouse_events.js +0 -417
- package/www/codemirror/src/edit/options.js +0 -194
- package/www/codemirror/src/edit/utils.js +0 -7
- package/www/codemirror/src/input/ContentEditableInput.js +0 -546
- package/www/codemirror/src/input/TextareaInput.js +0 -380
- package/www/codemirror/src/input/indent.js +0 -71
- package/www/codemirror/src/input/input.js +0 -134
- package/www/codemirror/src/input/keymap.js +0 -147
- package/www/codemirror/src/input/keynames.js +0 -17
- package/www/codemirror/src/input/movement.js +0 -111
- package/www/codemirror/src/line/highlight.js +0 -284
- package/www/codemirror/src/line/line_data.js +0 -349
- package/www/codemirror/src/line/pos.js +0 -40
- package/www/codemirror/src/line/saw_special_spans.js +0 -10
- package/www/codemirror/src/line/spans.js +0 -390
- package/www/codemirror/src/line/utils_line.js +0 -85
- package/www/codemirror/src/measurement/position_measurement.js +0 -702
- package/www/codemirror/src/measurement/widgets.js +0 -26
- package/www/codemirror/src/model/Doc.js +0 -436
- package/www/codemirror/src/model/change_measurement.js +0 -61
- package/www/codemirror/src/model/changes.js +0 -339
- package/www/codemirror/src/model/chunk.js +0 -167
- package/www/codemirror/src/model/document_data.js +0 -112
- package/www/codemirror/src/model/history.js +0 -228
- package/www/codemirror/src/model/line_widget.js +0 -78
- package/www/codemirror/src/model/mark_text.js +0 -293
- package/www/codemirror/src/model/selection.js +0 -84
- package/www/codemirror/src/model/selection_updates.js +0 -216
- package/www/codemirror/src/modes.js +0 -96
- package/www/codemirror/src/util/StringStream.js +0 -90
- package/www/codemirror/src/util/bidi.js +0 -215
- package/www/codemirror/src/util/browser.js +0 -34
- package/www/codemirror/src/util/dom.js +0 -101
- package/www/codemirror/src/util/event.js +0 -103
- package/www/codemirror/src/util/feature_detection.js +0 -84
- package/www/codemirror/src/util/misc.js +0 -168
- package/www/codemirror/src/util/operation_group.js +0 -72
- package/www/codemirror/theme/3024-day.css +0 -41
- package/www/codemirror/theme/3024-night.css +0 -39
- package/www/codemirror/theme/abbott.css +0 -268
- package/www/codemirror/theme/abcdef.css +0 -32
- package/www/codemirror/theme/ambiance-mobile.css +0 -5
- package/www/codemirror/theme/ambiance.css +0 -74
- package/www/codemirror/theme/ayu-dark.css +0 -44
- package/www/codemirror/theme/ayu-mirage.css +0 -45
- package/www/codemirror/theme/base16-dark.css +0 -40
- package/www/codemirror/theme/base16-light.css +0 -38
- package/www/codemirror/theme/bespin.css +0 -34
- package/www/codemirror/theme/blackboard.css +0 -32
- package/www/codemirror/theme/cobalt.css +0 -25
- package/www/codemirror/theme/colorforth.css +0 -33
- package/www/codemirror/theme/darcula.css +0 -53
- package/www/codemirror/theme/dracula.css +0 -40
- package/www/codemirror/theme/duotone-dark.css +0 -35
- package/www/codemirror/theme/duotone-light.css +0 -36
- package/www/codemirror/theme/eclipse.css +0 -23
- package/www/codemirror/theme/elegant.css +0 -13
- package/www/codemirror/theme/erlang-dark.css +0 -34
- package/www/codemirror/theme/gruvbox-dark.css +0 -39
- package/www/codemirror/theme/hopscotch.css +0 -34
- package/www/codemirror/theme/icecoder.css +0 -43
- package/www/codemirror/theme/idea.css +0 -42
- package/www/codemirror/theme/isotope.css +0 -34
- package/www/codemirror/theme/juejin.css +0 -30
- package/www/codemirror/theme/lesser-dark.css +0 -47
- package/www/codemirror/theme/liquibyte.css +0 -95
- package/www/codemirror/theme/lucario.css +0 -37
- package/www/codemirror/theme/material-darker.css +0 -135
- package/www/codemirror/theme/material-palenight.css +0 -141
- package/www/codemirror/theme/material.css +0 -141
- package/www/codemirror/theme/mbo.css +0 -37
- package/www/codemirror/theme/mdn-like.css +0 -46
- package/www/codemirror/theme/midnight.css +0 -39
- package/www/codemirror/theme/monokai.css +0 -41
- package/www/codemirror/theme/moxer.css +0 -143
- package/www/codemirror/theme/neat.css +0 -12
- package/www/codemirror/theme/neo.css +0 -43
- package/www/codemirror/theme/night.css +0 -27
- package/www/codemirror/theme/nord.css +0 -42
- package/www/codemirror/theme/oceanic-next.css +0 -46
- package/www/codemirror/theme/panda-syntax.css +0 -85
- package/www/codemirror/theme/paraiso-dark.css +0 -38
- package/www/codemirror/theme/paraiso-light.css +0 -38
- package/www/codemirror/theme/pastel-on-dark.css +0 -52
- package/www/codemirror/theme/railscasts.css +0 -34
- package/www/codemirror/theme/rubyblue.css +0 -25
- package/www/codemirror/theme/seti.css +0 -44
- package/www/codemirror/theme/shadowfox.css +0 -52
- package/www/codemirror/theme/solarized.css +0 -165
- package/www/codemirror/theme/ssms.css +0 -16
- package/www/codemirror/theme/the-matrix.css +0 -30
- package/www/codemirror/theme/tomorrow-night-bright.css +0 -35
- package/www/codemirror/theme/tomorrow-night-eighties.css +0 -38
- package/www/codemirror/theme/ttcn.css +0 -64
- package/www/codemirror/theme/twilight.css +0 -32
- package/www/codemirror/theme/vibrant-ink.css +0 -34
- package/www/codemirror/theme/xq-dark.css +0 -53
- package/www/codemirror/theme/xq-light.css +0 -43
- package/www/codemirror/theme/yeti.css +0 -44
- package/www/codemirror/theme/yonce.css +0 -59
- package/www/codemirror/theme/zenburn.css +0 -37
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../lib/codemirror"));
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../lib/codemirror"], mod);
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror);
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
var cmds = CodeMirror.commands;
|
|
15
|
-
var Pos = CodeMirror.Pos;
|
|
16
|
-
function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
|
|
17
|
-
|
|
18
|
-
// Kill 'ring'
|
|
19
|
-
|
|
20
|
-
var killRing = [];
|
|
21
|
-
function addToRing(str) {
|
|
22
|
-
killRing.push(str);
|
|
23
|
-
if (killRing.length > 50) killRing.shift();
|
|
24
|
-
}
|
|
25
|
-
function growRingTop(str) {
|
|
26
|
-
if (!killRing.length) return addToRing(str);
|
|
27
|
-
killRing[killRing.length - 1] += str;
|
|
28
|
-
}
|
|
29
|
-
function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; }
|
|
30
|
-
function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
|
|
31
|
-
|
|
32
|
-
var lastKill = null;
|
|
33
|
-
|
|
34
|
-
// Internal generic kill function, used by several mapped kill "family" functions.
|
|
35
|
-
function _kill(cm, from, to, ring, text) {
|
|
36
|
-
if (text == null) text = cm.getRange(from, to);
|
|
37
|
-
|
|
38
|
-
if (ring == "grow" && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
|
|
39
|
-
growRingTop(text);
|
|
40
|
-
else if (ring !== false)
|
|
41
|
-
addToRing(text);
|
|
42
|
-
cm.replaceRange("", from, to, "+delete");
|
|
43
|
-
|
|
44
|
-
if (ring == "grow") lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
|
|
45
|
-
else lastKill = null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Boundaries of various units
|
|
49
|
-
|
|
50
|
-
function byChar(cm, pos, dir) {
|
|
51
|
-
return cm.findPosH(pos, dir, "char", true);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function byWord(cm, pos, dir) {
|
|
55
|
-
return cm.findPosH(pos, dir, "word", true);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function byLine(cm, pos, dir) {
|
|
59
|
-
return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function byPage(cm, pos, dir) {
|
|
63
|
-
return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function byParagraph(cm, pos, dir) {
|
|
67
|
-
var no = pos.line, line = cm.getLine(no);
|
|
68
|
-
var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));
|
|
69
|
-
var fst = cm.firstLine(), lst = cm.lastLine();
|
|
70
|
-
for (;;) {
|
|
71
|
-
no += dir;
|
|
72
|
-
if (no < fst || no > lst)
|
|
73
|
-
return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));
|
|
74
|
-
line = cm.getLine(no);
|
|
75
|
-
var hasText = /\S/.test(line);
|
|
76
|
-
if (hasText) sawText = true;
|
|
77
|
-
else if (sawText) return Pos(no, 0);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function bySentence(cm, pos, dir) {
|
|
82
|
-
var line = pos.line, ch = pos.ch;
|
|
83
|
-
var text = cm.getLine(pos.line), sawWord = false;
|
|
84
|
-
for (;;) {
|
|
85
|
-
var next = text.charAt(ch + (dir < 0 ? -1 : 0));
|
|
86
|
-
if (!next) { // End/beginning of line reached
|
|
87
|
-
if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);
|
|
88
|
-
text = cm.getLine(line + dir);
|
|
89
|
-
if (!/\S/.test(text)) return Pos(line, ch);
|
|
90
|
-
line += dir;
|
|
91
|
-
ch = dir < 0 ? text.length : 0;
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));
|
|
95
|
-
if (!sawWord) sawWord = /\w/.test(next);
|
|
96
|
-
ch += dir;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function byExpr(cm, pos, dir) {
|
|
101
|
-
var wrap;
|
|
102
|
-
if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, {strict: true}))
|
|
103
|
-
&& wrap.match && (wrap.forward ? 1 : -1) == dir)
|
|
104
|
-
return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
|
|
105
|
-
|
|
106
|
-
for (var first = true;; first = false) {
|
|
107
|
-
var token = cm.getTokenAt(pos);
|
|
108
|
-
var after = Pos(pos.line, dir < 0 ? token.start : token.end);
|
|
109
|
-
if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) {
|
|
110
|
-
var newPos = cm.findPosH(after, dir, "char");
|
|
111
|
-
if (posEq(after, newPos)) return pos;
|
|
112
|
-
else pos = newPos;
|
|
113
|
-
} else {
|
|
114
|
-
return after;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Prefixes (only crudely supported)
|
|
120
|
-
|
|
121
|
-
function getPrefix(cm, precise) {
|
|
122
|
-
var digits = cm.state.emacsPrefix;
|
|
123
|
-
if (!digits) return precise ? null : 1;
|
|
124
|
-
clearPrefix(cm);
|
|
125
|
-
return digits == "-" ? -1 : Number(digits);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function repeated(cmd) {
|
|
129
|
-
var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd;
|
|
130
|
-
return function(cm) {
|
|
131
|
-
var prefix = getPrefix(cm);
|
|
132
|
-
f(cm);
|
|
133
|
-
for (var i = 1; i < prefix; ++i) f(cm);
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function findEnd(cm, pos, by, dir) {
|
|
138
|
-
var prefix = getPrefix(cm);
|
|
139
|
-
if (prefix < 0) { dir = -dir; prefix = -prefix; }
|
|
140
|
-
for (var i = 0; i < prefix; ++i) {
|
|
141
|
-
var newPos = by(cm, pos, dir);
|
|
142
|
-
if (posEq(newPos, pos)) break;
|
|
143
|
-
pos = newPos;
|
|
144
|
-
}
|
|
145
|
-
return pos;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function move(by, dir) {
|
|
149
|
-
var f = function(cm) {
|
|
150
|
-
cm.extendSelection(findEnd(cm, cm.getCursor(), by, dir));
|
|
151
|
-
};
|
|
152
|
-
f.motion = true;
|
|
153
|
-
return f;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function killTo(cm, by, dir, ring) {
|
|
157
|
-
var selections = cm.listSelections(), cursor;
|
|
158
|
-
var i = selections.length;
|
|
159
|
-
while (i--) {
|
|
160
|
-
cursor = selections[i].head;
|
|
161
|
-
_kill(cm, cursor, findEnd(cm, cursor, by, dir), ring);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function _killRegion(cm, ring) {
|
|
166
|
-
if (cm.somethingSelected()) {
|
|
167
|
-
var selections = cm.listSelections(), selection;
|
|
168
|
-
var i = selections.length;
|
|
169
|
-
while (i--) {
|
|
170
|
-
selection = selections[i];
|
|
171
|
-
_kill(cm, selection.anchor, selection.head, ring);
|
|
172
|
-
}
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function addPrefix(cm, digit) {
|
|
178
|
-
if (cm.state.emacsPrefix) {
|
|
179
|
-
if (digit != "-") cm.state.emacsPrefix += digit;
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
// Not active yet
|
|
183
|
-
cm.state.emacsPrefix = digit;
|
|
184
|
-
cm.on("keyHandled", maybeClearPrefix);
|
|
185
|
-
cm.on("inputRead", maybeDuplicateInput);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true};
|
|
189
|
-
|
|
190
|
-
function maybeClearPrefix(cm, arg) {
|
|
191
|
-
if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg))
|
|
192
|
-
clearPrefix(cm);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function clearPrefix(cm) {
|
|
196
|
-
cm.state.emacsPrefix = null;
|
|
197
|
-
cm.off("keyHandled", maybeClearPrefix);
|
|
198
|
-
cm.off("inputRead", maybeDuplicateInput);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function maybeDuplicateInput(cm, event) {
|
|
202
|
-
var dup = getPrefix(cm);
|
|
203
|
-
if (dup > 1 && event.origin == "+input") {
|
|
204
|
-
var one = event.text.join("\n"), txt = "";
|
|
205
|
-
for (var i = 1; i < dup; ++i) txt += one;
|
|
206
|
-
cm.replaceSelection(txt);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function maybeRemovePrefixMap(cm, arg) {
|
|
211
|
-
if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return;
|
|
212
|
-
cm.removeKeyMap(prefixMap);
|
|
213
|
-
cm.state.emacsPrefixMap = false;
|
|
214
|
-
cm.off("keyHandled", maybeRemovePrefixMap);
|
|
215
|
-
cm.off("inputRead", maybeRemovePrefixMap);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Utilities
|
|
219
|
-
|
|
220
|
-
cmds.setMark = function (cm) {
|
|
221
|
-
cm.setCursor(cm.getCursor());
|
|
222
|
-
cm.setExtending(!cm.getExtending());
|
|
223
|
-
cm.on("change", function() { cm.setExtending(false); });
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function clearMark(cm) {
|
|
227
|
-
cm.setExtending(false);
|
|
228
|
-
cm.setCursor(cm.getCursor());
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function makePrompt(msg) {
|
|
232
|
-
var fragment = document.createDocumentFragment();
|
|
233
|
-
var input = document.createElement("input");
|
|
234
|
-
input.setAttribute("type", "text");
|
|
235
|
-
input.style.width = "10em";
|
|
236
|
-
fragment.appendChild(document.createTextNode(msg + ": "));
|
|
237
|
-
fragment.appendChild(input);
|
|
238
|
-
return fragment;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function getInput(cm, msg, f) {
|
|
242
|
-
if (cm.openDialog)
|
|
243
|
-
cm.openDialog(makePrompt(msg), f, {bottom: true});
|
|
244
|
-
else
|
|
245
|
-
f(prompt(msg, ""));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function operateOnWord(cm, op) {
|
|
249
|
-
var start = cm.getCursor(), end = cm.findPosH(start, 1, "word");
|
|
250
|
-
cm.replaceRange(op(cm.getRange(start, end)), start, end);
|
|
251
|
-
cm.setCursor(end);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function toEnclosingExpr(cm) {
|
|
255
|
-
var pos = cm.getCursor(), line = pos.line, ch = pos.ch;
|
|
256
|
-
var stack = [];
|
|
257
|
-
while (line >= cm.firstLine()) {
|
|
258
|
-
var text = cm.getLine(line);
|
|
259
|
-
for (var i = ch == null ? text.length : ch; i > 0;) {
|
|
260
|
-
var ch = text.charAt(--i);
|
|
261
|
-
if (ch == ")")
|
|
262
|
-
stack.push("(");
|
|
263
|
-
else if (ch == "]")
|
|
264
|
-
stack.push("[");
|
|
265
|
-
else if (ch == "}")
|
|
266
|
-
stack.push("{");
|
|
267
|
-
else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch))
|
|
268
|
-
return cm.extendSelection(Pos(line, i));
|
|
269
|
-
}
|
|
270
|
-
--line; ch = null;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// Commands. Names should match emacs function names (albeit in camelCase)
|
|
275
|
-
// except where emacs function names collide with code mirror core commands.
|
|
276
|
-
|
|
277
|
-
cmds.killRegion = function(cm) {
|
|
278
|
-
_kill(cm, cm.getCursor("start"), cm.getCursor("end"), true);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
// Maps to emacs kill-line
|
|
282
|
-
cmds.killLineEmacs = repeated(function(cm) {
|
|
283
|
-
var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
|
|
284
|
-
var text = cm.getRange(start, end);
|
|
285
|
-
if (!/\S/.test(text)) {
|
|
286
|
-
text += "\n";
|
|
287
|
-
end = Pos(start.line + 1, 0);
|
|
288
|
-
}
|
|
289
|
-
_kill(cm, start, end, "grow", text);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
cmds.killRingSave = function(cm) {
|
|
293
|
-
addToRing(cm.getSelection());
|
|
294
|
-
clearMark(cm);
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
cmds.yank = function(cm) {
|
|
298
|
-
var start = cm.getCursor();
|
|
299
|
-
cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
|
|
300
|
-
cm.setSelection(start, cm.getCursor());
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
cmds.yankPop = function(cm) {
|
|
304
|
-
cm.replaceSelection(popFromRing(), "around", "paste");
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
cmds.forwardChar = move(byChar, 1);
|
|
308
|
-
|
|
309
|
-
cmds.backwardChar = move(byChar, -1)
|
|
310
|
-
|
|
311
|
-
cmds.deleteChar = function(cm) { killTo(cm, byChar, 1, false); };
|
|
312
|
-
|
|
313
|
-
cmds.deleteForwardChar = function(cm) {
|
|
314
|
-
_killRegion(cm, false) || killTo(cm, byChar, 1, false);
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
cmds.deleteBackwardChar = function(cm) {
|
|
318
|
-
_killRegion(cm, false) || killTo(cm, byChar, -1, false);
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
cmds.forwardWord = move(byWord, 1);
|
|
322
|
-
|
|
323
|
-
cmds.backwardWord = move(byWord, -1);
|
|
324
|
-
|
|
325
|
-
cmds.killWord = function(cm) { killTo(cm, byWord, 1, "grow"); };
|
|
326
|
-
|
|
327
|
-
cmds.backwardKillWord = function(cm) { killTo(cm, byWord, -1, "grow"); };
|
|
328
|
-
|
|
329
|
-
cmds.nextLine = move(byLine, 1);
|
|
330
|
-
|
|
331
|
-
cmds.previousLine = move(byLine, -1);
|
|
332
|
-
|
|
333
|
-
cmds.scrollDownCommand = move(byPage, -1);
|
|
334
|
-
|
|
335
|
-
cmds.scrollUpCommand = move(byPage, 1);
|
|
336
|
-
|
|
337
|
-
cmds.backwardParagraph = move(byParagraph, -1);
|
|
338
|
-
|
|
339
|
-
cmds.forwardParagraph = move(byParagraph, 1);
|
|
340
|
-
|
|
341
|
-
cmds.backwardSentence = move(bySentence, -1);
|
|
342
|
-
|
|
343
|
-
cmds.forwardSentence = move(bySentence, 1);
|
|
344
|
-
|
|
345
|
-
cmds.killSentence = function(cm) { killTo(cm, bySentence, 1, "grow"); };
|
|
346
|
-
|
|
347
|
-
cmds.backwardKillSentence = function(cm) {
|
|
348
|
-
_kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), "grow");
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
cmds.killSexp = function(cm) { killTo(cm, byExpr, 1, "grow"); };
|
|
352
|
-
|
|
353
|
-
cmds.backwardKillSexp = function(cm) { killTo(cm, byExpr, -1, "grow"); };
|
|
354
|
-
|
|
355
|
-
cmds.forwardSexp = move(byExpr, 1);
|
|
356
|
-
|
|
357
|
-
cmds.backwardSexp = move(byExpr, -1);
|
|
358
|
-
|
|
359
|
-
cmds.markSexp = function(cm) {
|
|
360
|
-
var cursor = cm.getCursor();
|
|
361
|
-
cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor);
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
cmds.transposeSexps = function(cm) {
|
|
365
|
-
var leftStart = byExpr(cm, cm.getCursor(), -1);
|
|
366
|
-
var leftEnd = byExpr(cm, leftStart, 1);
|
|
367
|
-
var rightEnd = byExpr(cm, leftEnd, 1);
|
|
368
|
-
var rightStart = byExpr(cm, rightEnd, -1);
|
|
369
|
-
cm.replaceRange(cm.getRange(rightStart, rightEnd) +
|
|
370
|
-
cm.getRange(leftEnd, rightStart) +
|
|
371
|
-
cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
cmds.backwardUpList = repeated(toEnclosingExpr);
|
|
375
|
-
|
|
376
|
-
cmds.justOneSpace = function(cm) {
|
|
377
|
-
var pos = cm.getCursor(), from = pos.ch;
|
|
378
|
-
var to = pos.ch, text = cm.getLine(pos.line);
|
|
379
|
-
while (from && /\s/.test(text.charAt(from - 1))) --from;
|
|
380
|
-
while (to < text.length && /\s/.test(text.charAt(to))) ++to;
|
|
381
|
-
cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
cmds.openLine = repeated(function(cm) {
|
|
385
|
-
cm.replaceSelection("\n", "start");
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
// maps to emacs 'transpose-chars'
|
|
389
|
-
cmds.transposeCharsRepeatable = repeated(function(cm) {
|
|
390
|
-
cm.execCommand("transposeChars");
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
cmds.capitalizeWord = repeated(function(cm) {
|
|
394
|
-
operateOnWord(cm, function(w) {
|
|
395
|
-
var letter = w.search(/\w/);
|
|
396
|
-
if (letter == -1) return w;
|
|
397
|
-
return w.slice(0, letter) + w.charAt(letter).toUpperCase() +
|
|
398
|
-
w.slice(letter + 1).toLowerCase();
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
cmds.upcaseWord = repeated(function(cm) {
|
|
403
|
-
operateOnWord(cm, function(w) { return w.toUpperCase(); });
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
cmds.downcaseWord = repeated(function(cm) {
|
|
407
|
-
operateOnWord(cm, function(w) { return w.toLowerCase(); });
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
// maps to emacs 'undo'
|
|
411
|
-
cmds.undoRepeatable = repeated("undo");
|
|
412
|
-
|
|
413
|
-
cmds.keyboardQuit = function(cm) {
|
|
414
|
-
cm.execCommand("clearSearch");
|
|
415
|
-
clearMark(cm);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
cmds.newline = repeated(function(cm) { cm.replaceSelection("\n", "end"); });
|
|
419
|
-
|
|
420
|
-
cmds.gotoLine = function(cm) {
|
|
421
|
-
var prefix = getPrefix(cm, true);
|
|
422
|
-
if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
|
|
423
|
-
|
|
424
|
-
getInput(cm, "Goto line", function(str) {
|
|
425
|
-
var num;
|
|
426
|
-
if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
|
|
427
|
-
cm.setCursor(num - 1);
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
cmds.indentRigidly = function(cm) {
|
|
432
|
-
cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
cmds.exchangePointAndMark = function(cm) {
|
|
436
|
-
cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
cmds.quotedInsertTab = repeated("insertTab");
|
|
440
|
-
|
|
441
|
-
cmds.universalArgument = function addPrefixMap(cm) {
|
|
442
|
-
cm.state.emacsPrefixMap = true;
|
|
443
|
-
cm.addKeyMap(prefixMap);
|
|
444
|
-
cm.on("keyHandled", maybeRemovePrefixMap);
|
|
445
|
-
cm.on("inputRead", maybeRemovePrefixMap);
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
CodeMirror.emacs = {kill: _kill, killRegion: _killRegion, repeated: repeated};
|
|
449
|
-
|
|
450
|
-
// Actual keymap
|
|
451
|
-
var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
|
|
452
|
-
"Ctrl-W": "killRegion",
|
|
453
|
-
"Ctrl-K": "killLineEmacs",
|
|
454
|
-
"Alt-W": "killRingSave",
|
|
455
|
-
"Ctrl-Y": "yank",
|
|
456
|
-
"Alt-Y": "yankPop",
|
|
457
|
-
"Ctrl-Space": "setMark",
|
|
458
|
-
"Ctrl-Shift-2": "setMark",
|
|
459
|
-
"Ctrl-F": "forwardChar",
|
|
460
|
-
"Ctrl-B": "backwardChar",
|
|
461
|
-
"Right": "forwardChar",
|
|
462
|
-
"Left": "backwardChar",
|
|
463
|
-
"Ctrl-D": "deleteChar",
|
|
464
|
-
"Delete": "deleteForwardChar",
|
|
465
|
-
"Ctrl-H": "deleteBackwardChar",
|
|
466
|
-
"Backspace": "deleteBackwardChar",
|
|
467
|
-
"Alt-F": "forwardWord",
|
|
468
|
-
"Alt-B": "backwardWord",
|
|
469
|
-
"Alt-Right": "forwardWord",
|
|
470
|
-
"Alt-Left": "backwardWord",
|
|
471
|
-
"Alt-D": "killWord",
|
|
472
|
-
"Alt-Backspace": "backwardKillWord",
|
|
473
|
-
"Ctrl-N": "nextLine",
|
|
474
|
-
"Ctrl-P": "previousLine",
|
|
475
|
-
"Down": "nextLine",
|
|
476
|
-
"Up": "previousLine",
|
|
477
|
-
"Ctrl-A": "goLineStart",
|
|
478
|
-
"Ctrl-E": "goLineEnd",
|
|
479
|
-
"End": "goLineEnd",
|
|
480
|
-
"Home": "goLineStart",
|
|
481
|
-
"Alt-V": "scrollDownCommand",
|
|
482
|
-
"Ctrl-V": "scrollUpCommand",
|
|
483
|
-
"PageUp": "scrollDownCommand",
|
|
484
|
-
"PageDown": "scrollUpCommand",
|
|
485
|
-
"Ctrl-Up": "backwardParagraph",
|
|
486
|
-
"Ctrl-Down": "forwardParagraph",
|
|
487
|
-
"Alt-{": "backwardParagraph",
|
|
488
|
-
"Alt-}": "forwardParagraph",
|
|
489
|
-
"Alt-A": "backwardSentence",
|
|
490
|
-
"Alt-E": "forwardSentence",
|
|
491
|
-
"Alt-K": "killSentence",
|
|
492
|
-
"Ctrl-X Delete": "backwardKillSentence",
|
|
493
|
-
"Ctrl-Alt-K": "killSexp",
|
|
494
|
-
"Ctrl-Alt-Backspace": "backwardKillSexp",
|
|
495
|
-
"Ctrl-Alt-F": "forwardSexp",
|
|
496
|
-
"Ctrl-Alt-B": "backwardSexp",
|
|
497
|
-
"Shift-Ctrl-Alt-2": "markSexp",
|
|
498
|
-
"Ctrl-Alt-T": "transposeSexps",
|
|
499
|
-
"Ctrl-Alt-U": "backwardUpList",
|
|
500
|
-
"Alt-Space": "justOneSpace",
|
|
501
|
-
"Ctrl-O": "openLine",
|
|
502
|
-
"Ctrl-T": "transposeCharsRepeatable",
|
|
503
|
-
"Alt-C": "capitalizeWord",
|
|
504
|
-
"Alt-U": "upcaseWord",
|
|
505
|
-
"Alt-L": "downcaseWord",
|
|
506
|
-
"Alt-;": "toggleComment",
|
|
507
|
-
"Ctrl-/": "undoRepeatable",
|
|
508
|
-
"Shift-Ctrl--": "undoRepeatable",
|
|
509
|
-
"Ctrl-Z": "undoRepeatable",
|
|
510
|
-
"Cmd-Z": "undoRepeatable",
|
|
511
|
-
"Ctrl-X U": "undoRepeatable",
|
|
512
|
-
"Shift-Ctrl-Z": "redo",
|
|
513
|
-
"Shift-Alt-,": "goDocStart",
|
|
514
|
-
"Shift-Alt-.": "goDocEnd",
|
|
515
|
-
"Ctrl-S": "findPersistentNext",
|
|
516
|
-
"Ctrl-R": "findPersistentPrev",
|
|
517
|
-
"Ctrl-G": "keyboardQuit",
|
|
518
|
-
"Shift-Alt-5": "replace",
|
|
519
|
-
"Alt-/": "autocomplete",
|
|
520
|
-
"Enter": "newlineAndIndent",
|
|
521
|
-
"Ctrl-J": "newline",
|
|
522
|
-
"Tab": "indentAuto",
|
|
523
|
-
"Alt-G G": "gotoLine",
|
|
524
|
-
"Ctrl-X Tab": "indentRigidly",
|
|
525
|
-
"Ctrl-X Ctrl-X": "exchangePointAndMark",
|
|
526
|
-
"Ctrl-X Ctrl-S": "save",
|
|
527
|
-
"Ctrl-X Ctrl-W": "save",
|
|
528
|
-
"Ctrl-X S": "saveAll",
|
|
529
|
-
"Ctrl-X F": "open",
|
|
530
|
-
"Ctrl-X K": "close",
|
|
531
|
-
"Ctrl-X H": "selectAll",
|
|
532
|
-
"Ctrl-Q Tab": "quotedInsertTab",
|
|
533
|
-
"Ctrl-U": "universalArgument",
|
|
534
|
-
"fallthrough": "default"
|
|
535
|
-
});
|
|
536
|
-
|
|
537
|
-
var prefixMap = {"Ctrl-G": clearPrefix};
|
|
538
|
-
function regPrefix(d) {
|
|
539
|
-
prefixMap[d] = function(cm) { addPrefix(cm, d); };
|
|
540
|
-
keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); };
|
|
541
|
-
prefixPreservingKeys["Ctrl-" + d] = true;
|
|
542
|
-
}
|
|
543
|
-
for (var i = 0; i < 10; ++i) regPrefix(String(i));
|
|
544
|
-
regPrefix("-");
|
|
545
|
-
});
|