codemirror-rails 5.9 → 5.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,68 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function (mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../yaml/yaml"))
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../yaml/yaml"], mod)
9
+ else // Plain browser env
10
+ mod(CodeMirror)
11
+ })(function (CodeMirror) {
12
+
13
+ var START = 0, FRONTMATTER = 1, BODY = 2
14
+
15
+ // a mixed mode for Markdown text with an optional YAML front matter
16
+ CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) {
17
+ var yamlMode = CodeMirror.getMode(config, "yaml")
18
+ var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm")
19
+
20
+ function curMode(state) {
21
+ return state.state == BODY ? innerMode : yamlMode
22
+ }
23
+
24
+ return {
25
+ startState: function () {
26
+ return {
27
+ state: START,
28
+ inner: CodeMirror.startState(yamlMode)
29
+ }
30
+ },
31
+ copyState: function (state) {
32
+ return {
33
+ state: state.state,
34
+ inner: CodeMirror.copyState(curMode(state), state.inner)
35
+ }
36
+ },
37
+ token: function (stream, state) {
38
+ if (state.state == START) {
39
+ if (stream.match(/---/, false)) {
40
+ state.state = FRONTMATTER
41
+ return yamlMode.token(stream, state.inner)
42
+ } else {
43
+ stream.state = BODY
44
+ state.inner = CodeMirror.startState(innerMode)
45
+ return innerMode.token(stream, state.inner)
46
+ }
47
+ } else if (state.state == FRONTMATTER) {
48
+ var end = stream.sol() && stream.match(/---/, false)
49
+ var style = yamlMode.token(stream, state.inner)
50
+ if (end) {
51
+ state.state = BODY
52
+ state.inner = CodeMirror.startState(innerMode)
53
+ }
54
+ return style
55
+ } else {
56
+ return innerMode.token(stream, state.inner)
57
+ }
58
+ },
59
+ innerMode: function (state) {
60
+ return {mode: curMode(state), state: state.inner}
61
+ },
62
+ blankLine: function (state) {
63
+ var mode = curMode(state)
64
+ if (mode.blankLine) return mode.blankLine(state.inner)
65
+ }
66
+ }
67
+ })
68
+ })
@@ -165,7 +165,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
165
165
  }
166
166
 
167
167
  /* The fake, visible scrollbars. Used to force redraw during scrolling
168
- before actuall scrolling happens, thus preventing shaking and
168
+ before actual scrolling happens, thus preventing shaking and
169
169
  flickering artifacts. */
170
170
  .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
171
171
  position: absolute;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codemirror-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: '5.9'
4
+ version: '5.10'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Fixler
@@ -256,6 +256,7 @@ files:
256
256
  - vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js
257
257
  - vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js
258
258
  - vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js
259
+ - vendor/assets/javascripts/codemirror/addons/search/jump-to-line.js
259
260
  - vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js
260
261
  - vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.js
261
262
  - vendor/assets/javascripts/codemirror/addons/search/search.js
@@ -280,6 +281,7 @@ files:
280
281
  - vendor/assets/javascripts/codemirror/modes/cobol.js
281
282
  - vendor/assets/javascripts/codemirror/modes/coffeescript.js
282
283
  - vendor/assets/javascripts/codemirror/modes/commonlisp.js
284
+ - vendor/assets/javascripts/codemirror/modes/crystal.js
283
285
  - vendor/assets/javascripts/codemirror/modes/css.js
284
286
  - vendor/assets/javascripts/codemirror/modes/cypher.js
285
287
  - vendor/assets/javascripts/codemirror/modes/d.js
@@ -376,6 +378,7 @@ files:
376
378
  - vendor/assets/javascripts/codemirror/modes/vue.js
377
379
  - vendor/assets/javascripts/codemirror/modes/xml.js
378
380
  - vendor/assets/javascripts/codemirror/modes/xquery.js
381
+ - vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js
379
382
  - vendor/assets/javascripts/codemirror/modes/yaml.js
380
383
  - vendor/assets/javascripts/codemirror/modes/z80.js
381
384
  - vendor/assets/stylesheets/codemirror.css