mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix(REPL): indent depth 1 when multi line string
This commit is contained in:
parent
22ed2f65bb
commit
ba4ef3941a
1 changed files with 6 additions and 0 deletions
|
@ -532,6 +532,10 @@ impl VirtualMachine {
|
|||
if bk == BlockKind::AtMark {
|
||||
return;
|
||||
}
|
||||
if bk == BlockKind::MultiLineStr {
|
||||
self.length = 1;
|
||||
return;
|
||||
}
|
||||
self.length += 1;
|
||||
}
|
||||
|
||||
|
@ -770,6 +774,8 @@ pub trait Runnable: Sized + Default {
|
|||
// end of MultiLineStr
|
||||
if vm.now == BlockKind::MultiLineStr {
|
||||
vm.remove_block_kind();
|
||||
// set indent back to previous depth
|
||||
vm.length = vm.now_block.len();
|
||||
vm.push_code(line);
|
||||
vm.push_code("\n");
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue