Blame SOURCES/0270-grub-core-normal-term.c-Few-more-fixes-for-menu-entr.patch

f96e0b
From a36ddee93b64424dfd6c99fe919910c47a30836f Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Sun, 7 Apr 2013 17:48:22 +0200
f96e0b
Subject: [PATCH 270/482] 	* grub-core/normal/term.c: Few more fixes for
f96e0b
 menu entry editor 	rendering. 	Reported by: Andrey Borzenkov
f96e0b
 <arvidjaar@gmail.com>
f96e0b
f96e0b
---
f96e0b
 ChangeLog               |  6 ++++++
f96e0b
 grub-core/normal/term.c | 24 ++++++++++++++++--------
f96e0b
 2 files changed, 22 insertions(+), 8 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 9163911..8b90e7a 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,3 +1,9 @@
f96e0b
+2013-04-07  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
+	* grub-core/normal/term.c: Few more fixes for menu entry editor
f96e0b
+	rendering.
f96e0b
+	Reported by: Andrey Borzenkov <arvidjaar@gmail.com>
f96e0b
+
f96e0b
 2013-04-06  Andrey Borzenkov <arvidjaar@gmail.com>
f96e0b
 
f96e0b
 	* conf/Makefile.extra-dist (EXTRA_DIST): Add
f96e0b
diff --git a/grub-core/normal/term.c b/grub-core/normal/term.c
f96e0b
index f05184b..d73d29c 100644
f96e0b
--- a/grub-core/normal/term.c
f96e0b
+++ b/grub-core/normal/term.c
f96e0b
@@ -746,9 +746,12 @@ print_ucs4_terminal (const grub_uint32_t * str,
f96e0b
 	  putcode_real (*ptr2, term, fixed_tab);
f96e0b
 	}
f96e0b
 
f96e0b
-      sp = max_width - pos[last_position - str].x + 1;
f96e0b
-      if (sp > 0)
f96e0b
-	grub_print_spaces (term, sp);
f96e0b
+      if (contchar)
f96e0b
+	{
f96e0b
+	  sp = max_width - pos[last_position - str].x + 1;
f96e0b
+	  if (sp > 0)
f96e0b
+	    grub_print_spaces (term, sp);
f96e0b
+	}
f96e0b
     }
f96e0b
   return dry_run ? lines : 0;
f96e0b
 }
f96e0b
@@ -780,7 +783,8 @@ put_glyphs_terminal (const struct grub_unicode_glyph *visual,
f96e0b
 		     grub_ssize_t visual_len,
f96e0b
 		     int margin_left, int margin_right,
f96e0b
 		     struct grub_term_output *term,
f96e0b
-		     struct term_state *state, int fixed_tab)
f96e0b
+		     struct term_state *state, int fixed_tab,
f96e0b
+		     grub_uint32_t contchar)
f96e0b
 {
f96e0b
   const struct grub_unicode_glyph *visual_ptr;
f96e0b
   for (visual_ptr = visual; visual_ptr < visual + visual_len; visual_ptr++)
f96e0b
@@ -799,7 +803,11 @@ put_glyphs_terminal (const struct grub_unicode_glyph *visual,
f96e0b
 	      return 1;
f96e0b
 	    }
f96e0b
 
f96e0b
-	  grub_print_spaces (term, margin_left);
f96e0b
+	  if (!contchar)
f96e0b
+	    grub_print_spaces (term, margin_left);
f96e0b
+	  else
f96e0b
+	    grub_term_gotoxy (term, margin_left,
f96e0b
+			      grub_term_getxy (term) & 0xff);
f96e0b
 	}
f96e0b
       grub_free (visual_ptr->combining);
f96e0b
     }
f96e0b
@@ -839,7 +847,7 @@ print_backlog (struct grub_term_output *term,
f96e0b
       ret = put_glyphs_terminal (state->backlog_glyphs,
f96e0b
 				 state->backlog_len,
f96e0b
 				 margin_left, margin_right, term, state,
f96e0b
-				 state->backlog_fixed_tab);
f96e0b
+				 state->backlog_fixed_tab, 0);
f96e0b
       if (!ret)
f96e0b
 	{
f96e0b
 	  grub_free (state->free);
f96e0b
@@ -942,8 +950,8 @@ print_ucs4_real (const grub_uint32_t * str,
f96e0b
       else
f96e0b
 	{
f96e0b
 	  ret = put_glyphs_terminal (visual_show, visual_len_show, margin_left,
f96e0b
-				     contchar ? margin_right : 1,
f96e0b
-				     term, state, fixed_tab);
f96e0b
+				     contchar ? 0 : margin_right,
f96e0b
+				     term, state, fixed_tab, contchar);
f96e0b
 
f96e0b
 	  if (!ret)
f96e0b
 	    grub_free (visual);
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b