You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
480 B

12 months ago
  1. var ace = require('brace');
  2. require('brace/mode/javascript');
  3. require('brace/theme/monokai');
  4. require('brace/keybinding/vim');
  5. var editor = ace.edit('javascript-editor');
  6. editor.getSession().setMode('ace/mode/javascript');
  7. editor.setTheme('ace/theme/monokai');
  8. editor.setKeyboardHandler('ace/keyboard/vim');
  9. editor.setValue([
  10. '// JavaScript'
  11. , 'var a = 3;'
  12. , ''
  13. , '// below line has an error which is annotated'
  14. , 'var b ='
  15. ].join('\n')
  16. );
  17. editor.clearSelection();