mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 09:03:02 +08:00
Disable do/end autocomplete in case it would move the cursor unexpectedly
This commit is contained in:
parent
caea9610ad
commit
90fb77b878
1 changed files with 8 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue