diff --git a/frontend/editor-poc.html b/frontend/editor-poc.html index 68c53e6..a8d628a 100644 --- a/frontend/editor-poc.html +++ b/frontend/editor-poc.html @@ -393,7 +393,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
- Type / for commands | Alt+/ autocomplete | Alt+I Insert + Type / for commands | Alt+\ autocomplete | Alt+I Insert Ctrl+J AI panel Ctrl+S save Ctrl+K link @@ -442,7 +442,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig Ctrl+SSauvegarder Clic sur le titreRenommer le fichier Ctrl+JPanneau AI - Alt+/Autocompletion intelligente + Alt+\Autocompletion intelligente Enter (liste)Continue la liste (-, *, 1.) et checkboxes Enter (liste vide)Termine la liste @@ -1786,8 +1786,8 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig else if (e.key === 'Escape') { e.preventDefault(); hideAutocomplete(); } return; } - // Alt+/ : force autocomplete - if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === '/') { + // Alt+\ : force autocomplete + if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === '\\') { e.preventDefault(); triggerAutocomplete(); return; @@ -1811,11 +1811,18 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig var taskMatch = currentLine.match(/^(\s*)([-*+])\s+\[([ xX])\]\s/); if (taskMatch) { - // Continue checkbox (empty, unchecked) - e.preventDefault(); - var newNumber = ''; - ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] '; - ta.setSelectionRange(ta.value.length, ta.value.length); + var afterTaskTrim = currentLine.slice(taskMatch[0].length).trim(); + if (afterTaskTrim.length === 0) { + // Empty checkbox: break list (remove this line) + e.preventDefault(); + ta.value = before.slice(0, lineStart) + after; + ta.setSelectionRange(lineStart, lineStart); + } else { + // Continue checkbox (empty, unchecked) + e.preventDefault(); + ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] '; + ta.setSelectionRange(ta.value.length, ta.value.length); + } markDirty(); autoHeight(); updateLineNumbers(); return; } else if (olMatch) { @@ -1861,7 +1868,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig console.log('ObsiGate Editor v2 ready'); console.log(' File: ' + (fileVault ? fileVault + '/' + filePath : 'demo mode')); console.log(' AI: checking...'); - console.log(' Type / for commands | Select text for bubble | Alt+/ autocomplete | Ctrl+J AI | Ctrl+S save'); + console.log(' Type / for commands | Select text for bubble | Alt+\\ autocomplete | Ctrl+J AI | Ctrl+S save'); })();