Merge pull request #3235 from github/add_codemirror_mode

Add Codemirror modes
This commit is contained in:
Arfon Smith
2016-09-21 20:17:48 -07:00
committed by GitHub
3 changed files with 211 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
/Gemfile.lock /Gemfile.lock
.bundle/ .bundle/
.idea
benchmark/ benchmark/
lib/linguist/samples.json lib/linguist/samples.json
/grammars /grammars

View File

@@ -300,6 +300,7 @@ module Linguist
end end
@ace_mode = attributes[:ace_mode] @ace_mode = attributes[:ace_mode]
@codemirror_mode = attributes[:codemirror_mode]
@wrap = attributes[:wrap] || false @wrap = attributes[:wrap] || false
# Set legacy search term # Set legacy search term
@@ -397,6 +398,17 @@ module Linguist
# Returns a String name or nil # Returns a String name or nil
attr_reader :ace_mode attr_reader :ace_mode
# Public: Get Codemirror mode
#
# Examples
#
# # => "nil"
# # => "javascript"
# # => "clike"
#
# Returns a String name or nil
attr_reader :codemirror_mode
# Public: Should language lines be wrapped # Public: Should language lines be wrapped
# #
# Returns true or false # Returns true or false

File diff suppressed because it is too large Load Diff