Disable do/end autocomplete in case it would move the cursor unexpectedly

This commit is contained in:
Jonatan Kłosko 2021-04-09 16:25:27 +02:00
parent caea9610ad
commit 90fb77b878

View file

@ -32,6 +32,14 @@ function closingEndTextEdits(model, position) {
const shouldInsertInNextLine =
position.lineNumber < lines.length && isBlank(line);
// If the next line is not available for inserting,
// we could insert `\nend` but this moves the cursor,
// so for now we just don't insert `end` at all
// For more context see https://github.com/elixir-nx/livebook/issues/152
if (!shouldInsertInNextLine) {
return [];
}
const textEdit = insertClosingEndTextEdit(
position,
prevIndentation,