0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-05-07 16:38:38 +00:00

fix keybinds

This commit is contained in:
Víctor Losada Hernández
2026-04-05 13:59:32 +02:00
parent 21e2619a99
commit 7d54261f51
+4 -1
View File
@@ -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){