Sha256: 8c79362a18a69d94684b54024f30c7f27da59b88fae426fb4a8f2f242564ce68

Contents?: true

Size: 677 Bytes

Versions: 40

Compression:

Stored size: 677 Bytes

Contents

CodeMirror.defineMode("diff", function() {

  var TOKEN_NAMES = {
    '+': 'positive',
    '-': 'negative',
    '@': 'meta'
  };

  return {
    token: function(stream) {
      var tw_pos = stream.string.search(/[\t ]+?$/);

      if (!stream.sol() || tw_pos === 0) {
        stream.skipToEnd();
        return ("error " + (
          TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
      }

      var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();

      if (tw_pos === -1) {
        stream.skipToEnd();
      } else {
        stream.pos = tw_pos;
      }

      return token_name;
    }
  };
});

CodeMirror.defineMIME("text/x-diff", "diff");

Version data entries

40 entries across 38 versions & 7 rubygems

Version Path
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
codemirror-rails-3.16 vendor/assets/javascripts/codemirror/modes/diff.js
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
codemirror-rails-3.15 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.14 vendor/assets/javascripts/codemirror/modes/diff.js
maglev-database-explorer-0.0.5 public/libs/codemirror/mode/diff/diff.js
maglev-database-explorer-0.0.4 public/libs/codemirror/mode/diff/diff.js
maglev-database-explorer-0.0.3 public/libs/codemirror/mode/diff/diff.js
maglev-database-explorer-0.0.2 public/libs/codemirror/mode/diff/diff.js
maglev-database-explorer-0.0.1 public/libs/codemirror/mode/diff/diff.js
codemirror-rails-3.13 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.12 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.02 vendor/assets/javascripts/codemirror/modes/diff.js
swagr-0.0.10 templates/static/js/codemirror/mode/diff/diff.js
swagr-0.0.10 examples/examples01/static/js/codemirror/mode/diff/diff.js
swagr-0.0.8 examples/examples01/static/js/codemirror/mode/diff/diff.js
swagr-0.0.8 templates/static/js/codemirror/mode/diff/diff.js
codemirror-rails-3.00 vendor/assets/javascripts/codemirror/modes/diff.js