Skip to content

Commit 74a42bf

Browse files
committed
Update the comments
1 parent 016da8d commit 74a42bf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

PSReadLine/Render.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,10 @@ void UpdateColorsIfNecessary(string newColor)
379379
// promptBufferCells is the number of visible characters in the prompt
380380
var promptBufferCells = LengthInBufferCells(promptText);
381381

382-
// The 'CursorLeft' could be less than error prompt cell length when
383-
// 1. console buffer was resized and the regular prompt takes a whole line of the new width buffer; OR
384-
// 2. the prompt function was changed and the new prompt is shorter than the error prompt.
382+
// The 'CursorLeft' could be less than error-prompt-cell-length when
383+
// 1. console buffer was resized, which causes the initial cursor to appear on the next line;
384+
// 2. prompt string gets longer (e.g. by 'cd' into nested folders), which causes the line to be wrapped to the next line;
385+
// 3. the prompt function was changed, which causes the new prompt string is shorter than the error prompt.
385386
// when this happens, we skip changing the color of the prompt.
386387
if (_console.CursorLeft >= promptBufferCells)
387388
{

0 commit comments

Comments
 (0)