Update the shift-click insertion

Insertion is now language specific.
This commit is contained in:
nemoyatpeace 2015-03-29 01:14:13 +08:00
parent 37d7b4661c
commit b50c3fbc89

View file

@ -905,7 +905,18 @@ module.exports = class SpellView extends CocoView
onCoordinateSelected: (e) ->
return unless @ace.isFocused() and e.x? and e.y?
@ace.insert "{x: #{e.x}, y: #{e.y}}"
if @spell.language is 'python'
@ace.insert "{\"x\": #{e.x}, \"y\": #{e.y}}"
else if @spell.language is 'clojure'
@ace.insert "{:x #{e.x} :y #{e.y}}"
else if @spell.language is 'lua'
@ace.insert "{x=#{e.x}, y=#{e.y}}"
else if @spell.language is 'io'
return
else
@ace.insert "{x: #{e.x}, y: #{e.y}}"
@highlightCurrentLine()
onStatementIndexUpdated: (e) ->