0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 09:02:37 +00:00

Make cursor move to end of snippet after insertion

This commit is contained in:
Trevor Buckner
2021-04-06 11:43:34 -04:00
parent a3b6a90fde
commit 983a37c77f
3 changed files with 4 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ const Editor = createClass({
lines[this.cursorPosition.line] = splice(lines[this.cursorPosition.line], this.cursorPosition.ch, injectText);
this.handleTextChange(lines.join('\n'));
this.refs.codeEditor.setCursorPosition(this.cursorPosition.line, this.cursorPosition.ch + injectText.length);
this.refs.codeEditor.setCursorPosition(this.cursorPosition.line + injectText.split('\n').length, this.cursorPosition.ch + injectText.length);
},
handgleToggle : function(){
this.setState({

View File

@@ -164,6 +164,7 @@ module.exports = {
:
### Actions
${_.times(_.random(genLines, genLines + 2), function(){return genAction();}).join('\n\t\t\t\n\t\t\t')}
}}`;
}}
\n`;
}
};

View File

@@ -231,7 +231,7 @@ body {
margin : 0px -6px 1em;
}
.useSansSerif();
-webkit-transform : translateZ(0); //Prevents shadows from breaking across columns
//-webkit-transform : translateZ(0); //Prevents shadows from breaking across columns, but breaks internal columns...
position : relative;
padding : 0px;
margin-bottom : 1em;