shell: tab inserts two spaces

This commit is contained in:
Kartik K. Agaram 2021-04-25 21:03:14 -07:00
parent cbebd548ca
commit 6bb70a236c
1 changed files with 8 additions and 0 deletions

View File

@ -971,6 +971,14 @@ fn edit-gap-buffer self: (addr gap-buffer), key: grapheme {
clear-gap-buffer self
return
}
{
compare g, 9/tab
break-if-!=
# tab = 2 spaces
add-code-point-at-gap self, 0x20/space
add-code-point-at-gap self, 0x20/space
return
}
# default: insert character
add-grapheme-at-gap self, g
}