fix reverse prompt and multi line

This commit is contained in:
Tomas 2023-05-03 18:47:11 +07:00 committed by GitHub
parent e216aa0463
commit b78af37cd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -551,12 +551,14 @@ int main(int argc, char ** argv) {
return 0; return 0;
} }
#endif #endif
if (line.empty() || line.back() != '\\') { if(!line.empty()){
another_line = false; if (line.back() == '\\') {
} else { line.pop_back(); // Remove the continue character
line.pop_back(); // Remove the continue character } else {
another_line = false;
}
buffer += line + '\n'; // Append the line to the result
} }
buffer += line + '\n'; // Append the line to the result
} while (another_line); } while (another_line);
// done taking input, reset color // done taking input, reset color