How to use ace as a command line control?

742 views
Skip to first unread message

Rob L

unread,
May 12, 2014, 10:20:19 AM5/12/14
to ace-d...@googlegroups.com
Hi,

I am going to use ace to replace the command line box at bottom of this page: http://viewplatgh.github.io/wrwd/
So I need to change ace's default behaviour but I don't know how.
The features I want include:
  1. use a (readonly) prompt text, e.g '>'
  2. use Vim or Emacs edit mode
  3. use a theme close to jquery-layout
  4. use single line only
  5. listen and handle command enter event 

Thanks
Rob Lao

Harutyun Amirjanyan

unread,
May 13, 2014, 3:08:59 PM5/13/14
to ace-d...@googlegroups.com
Hi

1. you can put > outside of the editor
2. editor.setKeyboardHandler("ace/keyboard/vim") or
editor.setKeyboardHandler("ace/keyboard/emacs")
3. pick one from ace/themes
4. see https://github.com/ajaxorg/ace/blob/d5566938ba/demo/kitchen-sink/layout.js#L103-L128
5. see https://github.com/ajaxorg/ace/blob/d5566938ba/demo/kitchen-sink/demo.js#L210-L221

Rob L

unread,
May 13, 2014, 11:59:28 PM5/13/14
to ace-d...@googlegroups.com
Thank you for your answers!

Thanks
Rob Lao

在 2014年5月14日星期三UTC+10上午5时08分59秒,Harutyun Amirjanyan写道:
Reply all
Reply to author
Forward
0 new messages