Remove Buffer.proto.getMode. All ace interaction should be mediated by LanguageMode

This commit is contained in:
Nathan Sobo 2012-06-13 18:09:28 -06:00
parent d04d4e22a2
commit 5f20b09284

View File

@ -164,22 +164,6 @@ class Buffer
isModified: ->
@modified
getMode: ->
return @mode if @mode
extension = if @getPath() then @getPath().split('/').pop().split('.').pop() else null
modeName = switch extension
when 'js' then 'javascript'
when 'coffee' then 'coffee'
when 'rb', 'ru' then 'ruby'
when 'c', 'h', 'cpp' then 'c_cpp'
when 'html', 'htm' then 'html'
when 'css' then 'css'
when 'java' then 'java'
when 'xml' then 'xml'
else 'text'
@mode = new (require("ace/mode/#{modeName}").Mode)
matchesInCharacterRange: (regex, startIndex, endIndex) ->
text = @getText()
matches = []