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
gump-0.1.6 server/assets/js/jquery.codemirror/mode/diff/diff.js
codemirror-rails-3.24 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.23 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.22 vendor/assets/javascripts/codemirror/modes/diff.js
mdbe-0.1.0 public/libs/codemirror/mode/diff/diff.js
codemirror-rails-3.21 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.20 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.19 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.18 vendor/assets/javascripts/codemirror/modes/diff.js
codemirror-rails-3.17 vendor/assets/javascripts/codemirror/modes/diff.js
poly-cms-0.1.2 core/admin/assets/js/vendor/codemirror/mode/diff/diff.js
poly-cms-0.1.1 core/admin/assets/js/vendor/codemirror/mode/diff/diff.js
poly-cms-0.1.0 core/admin/assets/js/vendor/codemirror/mode/diff/diff.js
bonethug-0.0.17 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/lib/codemirror/mode/diff/diff.js