mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Do not move to end request when auto indenting
This commit is contained in:
parent
faed2ae390
commit
281bb79432
1 changed files with 6 additions and 0 deletions
|
@ -146,7 +146,13 @@ define([
|
|||
editor.replaceRequestRange = function (newRequest, requestRange) {
|
||||
var text = utils.textFromRequest(newRequest);
|
||||
if (requestRange) {
|
||||
var pos = editor.getCursorPosition();
|
||||
editor.getSession().replace(requestRange, text);
|
||||
var max_row = Math.max(requestRange.start.row + text.split('\n').length -1 , 0);
|
||||
pos.row = Math.min(pos.row, max_row);
|
||||
editor.moveCursorToPosition(pos);
|
||||
// ACE UPGRADE - check if needed - at the moment the above may trigger a selection.
|
||||
editor.clearSelection();
|
||||
}
|
||||
else {
|
||||
// just insert where we are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue