Fix text input deletion

This commit is contained in:
Jake Shadle 2021-09-15 15:44:17 +02:00
parent 7d266d418c
commit 97d62422f9

View File

@ -288,8 +288,9 @@ where
}
};
// it should always end with this \0.
if self.buf.ends_with('\0') {
// it should always end with one (or more if characters were deleted)
// null terminators
while self.buf.ends_with('\0') {
self.buf.pop();
}
@ -386,8 +387,9 @@ impl<'ui, 'p, T: InputTextCallbackHandler, L: AsRef<str>> InputTextMultiline<'ui
)
};
// it should always end with this \0.
if self.buf.ends_with('\0') {
// it should always end with one (or more if characters were deleted)
// null terminators
while self.buf.ends_with('\0') {
self.buf.pop();
}