mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-05-07 18:48:39 +00:00
fix keybinds
This commit is contained in:
@@ -190,7 +190,8 @@ const CodeEditor = createReactClass({
|
||||
|
||||
// Use for GFM tabs that use common hot-keys
|
||||
isGFM : function() {
|
||||
if((this.isGFM()) || (this.props.tab === 'brewSnippets')) return true;
|
||||
console.log(this.props.tab);
|
||||
if( this.props.tab === 'brewText' || this.props.tab === 'brewSnippets') return true;
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -227,7 +228,9 @@ const CodeEditor = createReactClass({
|
||||
},
|
||||
|
||||
makeBold : function() {
|
||||
console.log('hello');
|
||||
if(!this.isGFM()) return;
|
||||
console.log(this.isGFM());
|
||||
const selection = this.codeMirror?.getSelection(), t = selection.slice(0, 2) === '**' && selection.slice(-2) === '**';
|
||||
this.codeMirror?.replaceSelection(t ? selection.slice(2, -2) : `**${selection}**`, 'around');
|
||||
if(selection.length === 0){
|
||||
|
||||
Reference in New Issue
Block a user