]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/normal/term.c: Few more fixes for menu entry editor
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 7 Apr 2013 15:48:22 +0000 (17:48 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 7 Apr 2013 15:48:22 +0000 (17:48 +0200)
rendering.
Reported by: Andrey Borzenkov <arvidjaar@gmail.com>

ChangeLog
grub-core/normal/term.c

index 9163911cee7099c4f3cbec1b5dc4982a037cbc14..8b90e7a45e058919161d456ab4c1da9864e1aa6d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-07  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/normal/term.c: Few more fixes for menu entry editor
+       rendering.
+       Reported by: Andrey Borzenkov <arvidjaar@gmail.com>
+
 2013-04-06  Andrey Borzenkov <arvidjaar@gmail.com>
 
        * conf/Makefile.extra-dist (EXTRA_DIST): Add
index f05184b46dbee8274295ed73c884890681474645..d73d29c5f2db6cc8e4176cf11dec145975a9366c 100644 (file)
@@ -746,9 +746,12 @@ print_ucs4_terminal (const grub_uint32_t * str,
          putcode_real (*ptr2, term, fixed_tab);
        }
 
-      sp = max_width - pos[last_position - str].x + 1;
-      if (sp > 0)
-       grub_print_spaces (term, sp);
+      if (contchar)
+       {
+         sp = max_width - pos[last_position - str].x + 1;
+         if (sp > 0)
+           grub_print_spaces (term, sp);
+       }
     }
   return dry_run ? lines : 0;
 }
@@ -780,7 +783,8 @@ put_glyphs_terminal (const struct grub_unicode_glyph *visual,
                     grub_ssize_t visual_len,
                     int margin_left, int margin_right,
                     struct grub_term_output *term,
-                    struct term_state *state, int fixed_tab)
+                    struct term_state *state, int fixed_tab,
+                    grub_uint32_t contchar)
 {
   const struct grub_unicode_glyph *visual_ptr;
   for (visual_ptr = visual; visual_ptr < visual + visual_len; visual_ptr++)
@@ -799,7 +803,11 @@ put_glyphs_terminal (const struct grub_unicode_glyph *visual,
              return 1;
            }
 
-         grub_print_spaces (term, margin_left);
+         if (!contchar)
+           grub_print_spaces (term, margin_left);
+         else
+           grub_term_gotoxy (term, margin_left,
+                             grub_term_getxy (term) & 0xff);
        }
       grub_free (visual_ptr->combining);
     }
@@ -839,7 +847,7 @@ print_backlog (struct grub_term_output *term,
       ret = put_glyphs_terminal (state->backlog_glyphs,
                                 state->backlog_len,
                                 margin_left, margin_right, term, state,
-                                state->backlog_fixed_tab);
+                                state->backlog_fixed_tab, 0);
       if (!ret)
        {
          grub_free (state->free);
@@ -942,8 +950,8 @@ print_ucs4_real (const grub_uint32_t * str,
       else
        {
          ret = put_glyphs_terminal (visual_show, visual_len_show, margin_left,
-                                    contchar ? margin_right : 1,
-                                    term, state, fixed_tab);
+                                    contchar ? 0 : margin_right,
+                                    term, state, fixed_tab, contchar);
 
          if (!ret)
            grub_free (visual);