@@ -2700,8 +2700,8 @@ <h2 id="addons">Addons</h2>
27002700 Defines < code > editor.showHint</ code > , which takes an optional
27012701 options object, and pops up a widget that allows the user to
27022702 select a completion. Finding hints is done with a hinting
2703- functions (the < code > hint</ code > option), which is a function
2704- that take an editor instance and options object, and return
2703+ function (the < code > hint</ code > option). This function
2704+ takes an editor instance and an options object, and returns
27052705 a < code > {list, from, to}</ code > object, where < code > list</ code >
27062706 is an array of strings or objects (the completions),
27072707 and < code > from</ code > and < code > to</ code > give the start and end
@@ -2771,9 +2771,22 @@ <h2 id="addons">Addons</h2>
27712771 < dt > < code > < strong > alignWithWord</ strong > : boolean</ code > </ dt >
27722772 < dd > Whether the pop-up should be horizontally aligned with the
27732773 start of the word (true, default), or with the cursor (false).</ dd >
2774+ < dt > < code > < strong > closeCharacters</ strong > : RegExp</ code > </ dt >
2775+ < dd > A regular expression object used to match characters which
2776+ cause the pop up to be closed (default: < code > /[\s()\[\]{};:> ,]/</ code > ).
2777+ If the user types one of these characters, the pop up will close, and
2778+ the < code > endCompletion</ code > event is fired on the editor instance.</ dd >
27742779 < dt > < code > < strong > closeOnUnfocus</ strong > : boolean</ code > </ dt >
27752780 < dd > When enabled (which is the default), the pop-up will close
27762781 when the editor is unfocused.</ dd >
2782+ < dt > < code > < strong > completeOnSingleClick</ strong > : boolean</ code > </ dt >
2783+ < dd > Whether a single click on a list item suffices to trigger the
2784+ completion (which is the default), or if the user has to use a
2785+ doubleclick.</ dd >
2786+ < dt > < code > < strong > container</ strong > : Element|null</ code > </ dt >
2787+ < dd > Can be used to define a custom container for the widget. The default
2788+ is < code > null</ code > , in which case the < code > body</ code > -element will
2789+ be used.</ dd >
27772790 < dt > < code > < strong > customKeys</ strong > : keymap</ code > </ dt >
27782791 < dd > Allows you to provide a custom key map of keys to be active
27792792 when the pop-up is active. The handlers will be called with an
@@ -2809,6 +2822,14 @@ <h2 id="addons">Addons</h2>
28092822 < dt > < code > < strong > "close"</ strong > ()</ code > </ dt >
28102823 < dd > Fired when the completion is finished.</ dd >
28112824 </ dl >
2825+ The following events will be fired on the editor instance during
2826+ completion:
2827+ < dl >
2828+ < dt > < code > < strong > "endCompletion"</ strong > ()</ code > </ dt >
2829+ < dd > Fired when the pop-up is being closed programmatically, e.g., when
2830+ the user types a character which matches the
2831+ < code > closeCharacters</ code > option.</ dd >
2832+ </ dl >
28122833 This addon depends on styles
28132834 from < code > addon/hint/show-hint.css</ code > . Check
28142835 out < a href ="../demo/complete.html "> the demo</ a > for an
0 commit comments