Showing
1 changed file
with
4 additions
and
1 deletions
| ... | ... | @@ -191,6 +191,7 @@ |
| 191 | 191 | aceEditor.value.setOptions({ |
| 192 | 192 | enableBasicAutocompletion: true, |
| 193 | 193 | enableLiveAutocompletion: true, |
| 194 | + enableSnippets: true, | |
| 194 | 195 | theme: getAceClass.value === 'dark' ? 'ace/theme/terminal' : 'ace/theme/chrome', |
| 195 | 196 | }); |
| 196 | 197 | aceEditor.value.setValue(''); |
| ... | ... | @@ -304,8 +305,10 @@ |
| 304 | 305 | }; |
| 305 | 306 | |
| 306 | 307 | const handleFormat = () => { |
| 308 | + let oldValue = aceEditor.value?.getValue() || ''; | |
| 309 | + oldValue = oldValue.replaceAll(/;(\n+)?/g, ';\n'); | |
| 310 | + aceEditor.value?.setValue(oldValue); | |
| 307 | 311 | beautify(aceEditor.value.session); |
| 308 | - aceEditor.value.getSession().setUseWrapMode(true); | |
| 309 | 312 | }; |
| 310 | 313 | |
| 311 | 314 | const [registerModal, { openModal }] = useModal(); | ... | ... |