rendering.
Reported by: Andrey Borzenkov <arvidjaar@gmail.com>
+2013-04-08 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-07 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/term.c: Few more fixes for menu entry editor
return 1;
}
+/* The max column number of an entry. The last "-1" is for a
+ continuation marker. */
+static inline int
+grub_term_entry_width (struct grub_term_output *term)
+{
+ return grub_term_border_width (term) - GRUB_TERM_MARGIN * 2 - 2;
+}
+
+
/* Return the number of lines occupied by this line on the screen. */
static int
get_logical_num_lines (struct line *linep, struct per_term_screen *term_screen)
GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1,
y + GRUB_TERM_FIRST_ENTRY_Y);
- for (i = 0; i < grub_term_entry_width (term_screen->term); i++)
+ for (i = 0; i < grub_term_entry_width (term_screen->term) + 1; i++)
grub_putcode (' ', term_screen->term);
}
grub_uint32_t contchar)
{
const struct grub_unicode_glyph *visual_ptr;
+ int since_last_nl = 1;
for (visual_ptr = visual; visual_ptr < visual + visual_len; visual_ptr++)
{
- if (visual_ptr->base == '\n')
- grub_print_spaces (term, margin_right);
+ if (visual_ptr->base == '\n' && contchar)
+ fill_margin (term, margin_right);
+
putglyph (visual_ptr, term, fixed_tab);
+ since_last_nl++;
if (visual_ptr->base == '\n')
{
+ since_last_nl = 0;
if (state && ++state->num_lines
>= (grub_ssize_t) grub_term_height (term) - 2)
{
}
grub_free (visual_ptr->combining);
}
+ if (contchar && since_last_nl)
+ fill_margin (term, margin_right);
+
return 0;
}
else
{
ret = put_glyphs_terminal (visual_show, visual_len_show, margin_left,
- contchar ? 0 : margin_right,
+ margin_right,
term, state, fixed_tab, contchar);
if (!ret)
return grub_term_width (term) - GRUB_TERM_MARGIN * 2;
}
-/* The max column number of an entry. The last "-1" is for a
- continuation marker. */
-static inline int
-grub_term_entry_width (struct grub_term_output *term)
-{
- return grub_term_border_width (term) - GRUB_TERM_MARGIN * 2 - 1;
-}
-
static inline grub_uint16_t
grub_term_getxy (struct grub_term_output *term)
{