From 1252d5231d81c548bccce52354ed86033b66ae37 Mon Sep 17 00:00:00 2001 From: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Date: Thu, 7 Mar 2024 22:41:01 +0000 Subject: [PATCH] feat: add better prompt marker in REPL's multi-line mode Signed-off-by: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> --- lib/node_modules/@stdlib/repl/lib/display_prompt.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/repl/lib/display_prompt.js b/lib/node_modules/@stdlib/repl/lib/display_prompt.js index eccb0e0998c0..401ad11d2ac8 100644 --- a/lib/node_modules/@stdlib/repl/lib/display_prompt.js +++ b/lib/node_modules/@stdlib/repl/lib/display_prompt.js @@ -26,6 +26,11 @@ var repeat = require( '@stdlib/string/repeat' ); var leadingWhitespaceRegExp = require( './regexp_leading_whitespace.js' ); +// VARIABLES // + +var BASE_PROMPT = '...: '; + + // MAIN // /** @@ -50,7 +55,7 @@ function displayPrompt( repl, preserveCursor ) { repl._rli.prompt( preserveCursor ); return; } - repl._rli.setPrompt( '' ); + repl._rli.setPrompt( repeat( ' ', 2 + String( repl._count ).length ) + BASE_PROMPT ); repl._rli.prompt( preserveCursor ); // Prepend the leading whitespace of the previous line: