From b78af37cd26e8be7b5720cae57392ffd7a8cc867 Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 3 May 2023 18:47:11 +0700 Subject: [PATCH 1/2] fix reverse prompt and multi line --- examples/main/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 125c189a38b34..35eabf4513e67 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -551,12 +551,14 @@ int main(int argc, char ** argv) { return 0; } #endif - if (line.empty() || line.back() != '\\') { - another_line = false; - } else { - line.pop_back(); // Remove the continue character + if(!line.empty()){ + if (line.back() == '\\') { + 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); // done taking input, reset color From 932e616cf4795f1a89261abaca8ae9c35d5a970a Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 4 May 2023 07:27:52 +0700 Subject: [PATCH 2/2] Code Formatting Co-authored-by: Georgi Gerganov --- examples/main/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 35eabf4513e67..17a5a90d167c8 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -551,7 +551,7 @@ int main(int argc, char ** argv) { return 0; } #endif - if(!line.empty()){ + if (!line.empty()) { if (line.back() == '\\') { line.pop_back(); // Remove the continue character } else {