Skip to content

Commit

Permalink
upgrade codemirror
Browse files Browse the repository at this point in the history
  • Loading branch information
benfb committed Nov 24, 2018
1 parent d355f8c commit 41d64ea
Show file tree
Hide file tree
Showing 293 changed files with 14,151 additions and 52,427 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Version 0.5.2
- Fix the creation of extraneous newline characters when loading a non-Gorilla Clojure file (#286)
- Warn in the browser when closing the Gorilla tab (this will be optional in 0.5.3) (#236)
- Upgrade to the most recent Codemirror version

## Version 0.5.1
- Fix typo
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;;;;
;;;; gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.

(defproject org.clojars.benfb/gorilla-repl "0.5.1"
(defproject org.clojars.benfb/gorilla-repl "0.5.2"
:description "A rich REPL for Clojure in the notebook style."
:url "https://github.com/benfb/gorilla-repl"
:license {:name "MIT"}
Expand Down
14 changes: 5 additions & 9 deletions resources/gorilla-repl-client/js/codemirrorVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,15 @@ var codemirrorVM = function (id, initialContents, contentType) {
ko.bindingHandlers.codemirror = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
// we define a custom CodeMirror keymap, which takes a few steps.
// First we need to define a CodeMirror command that does nothing
// (according to the CodeMirror docs, one should be able set a key-binding as 'false' and have it do nothing
// but I can't seem to get that to work.
CodeMirror.commands['doNothing'] = function () {};
// then patch the Mac default keymap to get rid of the emacsy binding, which interfere with our shortcuts
// First, we patch the Mac default keymap to get rid of the emacsy binding, which interfere with our shortcuts
CodeMirror.keyMap['macDefault'].fallthrough = "basic";
// and then create our custom map, which will fall through to the (patched) default. Shift+Enter and variants
// are stopped from doing anything.
CodeMirror.keyMap["gorilla"] = {
'Shift-Enter': "doNothing",
'Shift-Ctrl-Enter': "doNothing",
'Shift-Alt-Enter': "doNothing",
'Shift-Tab': "doNothing",
'Shift-Enter': false,
'Shift-Ctrl-Enter': false,
'Shift-Alt-Enter': false,
'Shift-Tab': false,
fallthrough: "default"};
var cm = CodeMirror.fromTextArea(element,
{
Expand Down
1 change: 1 addition & 0 deletions resources/gorilla-repl-client/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,4 @@ $(function () {
alert("Failed to make initial connection to nREPL server. Refreshing the page might help.");
});
});

Loading

0 comments on commit 41d64ea

Please sign in to comment.