💄 Use @constructor instead of EditorView

This commit is contained in:
Kevin Sawicki & Nathan Sobo
2013-12-05 17:15:20 -08:00
committed by Kevin Sawicki
parent 94e4fef108
commit f4861b7919

View File

@@ -1663,7 +1663,7 @@ class EditorView extends View
# Private:
getCharacterWidthCache: (scopes, char) ->
scopes ?= NoScope
obj = EditorView.characterWidthCache
obj = @constsructor.characterWidthCache
for scope in scopes
obj = obj[scope]
return null unless obj?
@@ -1672,7 +1672,7 @@ class EditorView extends View
# Private:
setCharacterWidthCache: (scopes, char, val) ->
scopes ?= NoScope
obj = EditorView.characterWidthCache
obj = @constructor.characterWidthCache
for scope in scopes
obj[scope] ?= {}
obj = obj[scope]
@@ -1680,7 +1680,7 @@ class EditorView extends View
# Private:
clearCharacterWidthCache: ->
EditorView.characterWidthCache = {}
@constructor.characterWidthCache = {}
pixelOffsetForScreenPosition: (position) ->
{top, left} = @pixelPositionForScreenPosition(position)