mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-31 17:22:45 +00:00
Snippets done
This commit is contained in:
@@ -24,7 +24,10 @@ var Editor = React.createClass({
|
||||
};
|
||||
},
|
||||
|
||||
cursorPosition : null,
|
||||
cursorPosition : {
|
||||
line : 0,
|
||||
ch : 0
|
||||
},
|
||||
|
||||
|
||||
componentDidMount: function() {
|
||||
@@ -41,7 +44,6 @@ var Editor = React.createClass({
|
||||
},
|
||||
|
||||
handleSnippetClick : function(injectText){
|
||||
if(!this.cursorPosition) return;
|
||||
var lines = this.props.value.split('\n');
|
||||
lines[this.cursorPosition.line] = splice(lines[this.cursorPosition.line], this.cursorPosition.ch, injectText);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user