don't select initial text on ':'

This commit is contained in:
Kevin Ushey 2015-03-16 15:33:00 -07:00
commit e551b090b7

View file

@ -571,7 +571,6 @@ define(function(require, exports, module) {
highlight.session.on("change", highlight.updateOnChange); highlight.session.on("change", highlight.updateOnChange);
} }
var re = new RegExp(o.query.source, "gmi"); var re = new RegExp(o.query.source, "gmi");
console.log(re)
this.$searchHighlight = o.highlight = highlight; this.$searchHighlight = o.highlight = highlight;
this.$searchHighlight.setRegexp(re); this.$searchHighlight.setRegexp(re);
this.ace.renderer.updateBackMarkers(); this.ace.renderer.updateBackMarkers();
@ -797,7 +796,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
if (inp) { if (inp) {
if (options.value) { if (options.value) {
inp.value = options.value; inp.value = options.value;
inp.select(); if (options.select !== false) inp.select();
} }
if (options.onInput) if (options.onInput)
@ -2029,7 +2028,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
} else { } else {
if (vim.visualMode) { if (vim.visualMode) {
showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>', showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
onKeyDown: onPromptKeyDown}); onKeyDown: onPromptKeyDown, select: false});
} else { } else {
showPrompt(cm, { onClose: onPromptClose, prefix: ':', showPrompt(cm, { onClose: onPromptClose, prefix: ':',
onKeyDown: onPromptKeyDown}); onKeyDown: onPromptKeyDown});
@ -4205,7 +4204,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
function dialog(cm, template, shortText, onClose, options) { function dialog(cm, template, shortText, onClose, options) {
if (cm.openDialog) { if (cm.openDialog) {
cm.openDialog(template, onClose, { bottom: true, value: options.value, cm.openDialog(template, onClose, { bottom: true, value: options.value,
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, select: options.select });
} }
else { else {
onClose(prompt(shortText, '')); onClose(prompt(shortText, ''));