]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Allow for format character strings to be typed in editor without having...
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 30 Jan 2012 18:44:41 +0000 (18:44 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 30 Jan 2012 18:44:41 +0000 (18:44 +0000)
signed-off-by: jcarsey
reviewed-by: leegrosenbaum

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12965 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index 7d8288432608ef8b158af815fe559aff86a1c63b..ff1d000aeb62384de31a13d4c41f513503fa250a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implements filebuffer interface functions.\r
 \r
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -489,6 +489,7 @@ FileBufferPrintLine (
   CHAR16  *Buffer;\r
   UINTN   Limit;\r
   CHAR16  PrintLine[200];\r
+  CHAR16  PrintLine2[250];\r
 \r
   //\r
   // print start from correct character\r
@@ -506,12 +507,13 @@ FileBufferPrintLine (
   }\r
 \r
   PrintLine[MainEditor.ScreenSize.Column] = CHAR_NULL;\r
+  ShellCopySearchAndReplace(PrintLine, PrintLine2,  250, L"%", L"^%", FALSE, FALSE);\r
 \r
   ShellPrintEx (\r
     0,\r
     (INT32)Row - 1,\r
     L"%s",\r
-    PrintLine\r
+    PrintLine2\r
     );\r
 \r
   return EFI_SUCCESS;\r
index aabd9140df132f98657550273085438fa0e11256..85a5d44f081495b553c64206f7fd31ab65d9948b 100644 (file)
@@ -2720,6 +2720,11 @@ InternalShellPrintWorker(
     //\r
     if (ResumeLocation != NULL) {\r
       if (*(ResumeLocation-1) == L'^') {\r
+        //\r
+        // Move cursor back 1 position to overwrite the ^\r
+        //\r
+        gST->ConOut->SetCursorPosition(gST->ConOut, gST->ConOut->Mode->CursorColumn - 1, gST->ConOut->Mode->CursorRow);\r
+\r
         //\r
         // Print a simple '%' symbol\r
         //\r