Let's say I have this bad JS code. It's missing a ) in first line. If I place caret after str and press ), it should print this char, so that line ends with )) { so that code is good. VSCode works as expected. But Cuda just moves caret to the right, keeping just one ).
Suggested way to handle this:
Inserting a closing pair should only be skipped while caret was always inside this pair block since its auto insertion. And also at the same line of the closing pair.
So, for instance, if I type in a new line if (, Cuda will insert the closing pair ) next to the cursor, then I type the condition expression, then press ), Cuda doesn't insert it because it was already there: correct. But once user moves caret out of the block, for instance if they place it in other line, then moves it back, Cuda shouldn't prevent the typing of ).
adding this needs some memory for previous input. so it's more hard to code. also: work of the bracket typing will be different depending on memory state: when memory 'allows' to insert, when not. and when 'allows', I can reopen file, move caret up/down, and then Cud 'disallows' to insert bracket? bad!
Let's say I have this bad JS code. It's missing a
)
in first line. If I place caret afterstr
and press)
, it should print this char, so that line ends with)) {
so that code is good. VSCode works as expected. But Cuda just moves caret to the right, keeping just one)
.Suggested way to handle this:
So, for instance, if I type in a new line
if (
, Cuda will insert the closing pair)
next to the cursor, then I type the condition expression, then press)
, Cuda doesn't insert it because it was already there: correct. But once user moves caret out of the block, for instance if they place it in other line, then moves it back, Cuda shouldn't prevent the typing of)
.I guess that's exactly how VSCode behaves.