diff --git a/css/general.css b/css/general.css index b397c1b6..7cc6422c 100644 --- a/css/general.css +++ b/css/general.css @@ -299,6 +299,18 @@ .markdown a { cursor: pointer; } + .markdown pre { + border: 1px solid var(--color-border); + background: var(--color-back); + font-family: var(--font-code); + padding: 6px 10px; + clear: both; + cursor: text; + user-select: text; + } + .markdown pre code { + user-select: text; + } /*Actions*/ .toolbar { diff --git a/js/interface/keyboard.js b/js/interface/keyboard.js index 4497e14b..4320ad8b 100644 --- a/js/interface/keyboard.js +++ b/js/interface/keyboard.js @@ -540,12 +540,21 @@ onVueSetup(function() { var missmatch = false; for (var word of keywords) { if ( + !missmatch && !action.name.toLowerCase().includes(word) && !action.id.toLowerCase().includes(word) && - !action.keybind.label.toLowerCase().includes(word) + !action.keybind.label.toLowerCase().includes(word) ) { missmatch = true; } + if (missmatch && action.sub_keybinds) { + for (let key in action.sub_keybinds) { + if (action.sub_keybinds[key].name.toLowerCase().includes(word)) { + missmatch = false; + } + } + } + if (missmatch) break; } if (!missmatch) { actions.push(action) diff --git a/js/io/io.js b/js/io/io.js index 5d65ed41..bcf175f5 100644 --- a/js/io/io.js +++ b/js/io/io.js @@ -499,6 +499,7 @@ function autoParseJSON(data, feedback) { data = JSON.parse(data) } catch (err) { if (feedback === false) return; + let error_part = ''; function logErrantPart(whole, start, length) { var line = whole.substr(0, start).match(/\n/gm) line = line ? line.length+1 : 1 @@ -507,7 +508,8 @@ function autoParseJSON(data, feedback) { lines.forEach((s, i) => { result += `#${line+i} ${s}\n` }) - console.log(result.substr(0, result.length-1) + ' <-- HERE') + error_part = result.substr(0, result.length-1) + ' <-- HERE'; + console.log(error_part); } console.error(err) var length = err.toString().split('at position ')[1] @@ -523,7 +525,7 @@ function autoParseJSON(data, feedback) { Blockbench.showMessageBox({ translateKey: 'invalid_file', icon: 'error', - message: tl('message.invalid_file.message', [err]) + message: tl('message.invalid_file.message', [err]) + (error_part ? `\n\n\`\`\`\n${error_part}\n\`\`\`` : '') }) return; }