+2015-08-21 Patrick Palka <patrick@parcs.ath.cx>
+
+ * tui/tui-data.h (tui_command_info): Remove fields cur_line and
+ curch.
+ * tui/tui-data.c (tui_clear_win_detail) [CMD_WIN]: Don't set
+ cur_line or curch, instead call wmove().
+ (init_win_info) [CMD_WIN]: Likewise.
+ * tui/tui-io.c (tui_puts): Likewise. Don't read cur_line,
+ instead call getcury().
+ (tui_redisplay_readline): Don't set cur_line or curch.
+ (tui_mld_erase_entire_line): Don't read cur_line, instead call
+ getcury().
+ (tui_cont_sig): Remove call to wmove.
+ (tui_getc): Don't read cur_line or curch, instead call getcury()
+ or getyx(). Don't set curch.
+ * tui/tui-win.c (make_visible_with_new_height) [CMD_WIN]: Don't
+ set cur_line or curch. Always move cursor to (0,0).
+
2015-08-20 Pedro Alves <palves@redhat.com>
* infrun.c (print_target_wait_results): Make extern.
else if (c == '\n')
tui_skip_line = -1;
}
- getyx (w, TUI_CMD_WIN->detail.command_info.cur_line,
- TUI_CMD_WIN->detail.command_info.curch);
- TUI_CMD_WIN->detail.command_info.start_line
- = TUI_CMD_WIN->detail.command_info.cur_line;
+ TUI_CMD_WIN->detail.command_info.start_line = getcury (w);
}
/* Readline callback.
waddch (w, c);
}
if (c == '\n')
- {
- getyx (w, TUI_CMD_WIN->detail.command_info.start_line,
- TUI_CMD_WIN->detail.command_info.curch);
- }
+ TUI_CMD_WIN->detail.command_info.start_line = getcury (w);
getyx (w, line, col);
if (col < prev_col)
height++;
prev_col = col;
}
wclrtobot (w);
- getyx (w, TUI_CMD_WIN->detail.command_info.start_line,
- TUI_CMD_WIN->detail.command_info.curch);
+ TUI_CMD_WIN->detail.command_info.start_line = getcury (w);
if (c_line >= 0)
- {
- wmove (w, c_line, c_pos);
- TUI_CMD_WIN->detail.command_info.cur_line = c_line;
- TUI_CMD_WIN->detail.command_info.curch = c_pos;
- }
+ wmove (w, c_line, c_pos);
TUI_CMD_WIN->detail.command_info.start_line -= height - 1;
wrefresh (w);
tui_mld_erase_entire_line (const struct match_list_displayer *displayer)
{
WINDOW *w = TUI_CMD_WIN->generic.handle;
+ int cur_y = getcury (w);
- wmove (w, TUI_CMD_WIN->detail.command_info.cur_line, 0);
+ wmove (w, cur_y, 0);
wclrtoeol (w);
- wmove (w, TUI_CMD_WIN->detail.command_info.cur_line, 0);
+ wmove (w, cur_y, 0);
}
/* TUI version of displayer.beep. */
/* Force a refresh of the screen. */
tui_refresh_all_win ();
- /* Update cursor position on the screen. */
- wmove (TUI_CMD_WIN->generic.handle,
- TUI_CMD_WIN->detail.command_info.start_line,
- TUI_CMD_WIN->detail.command_info.curch);
wrefresh (TUI_CMD_WIN->generic.handle);
}
signal (sig, tui_cont_sig);
user we recognized the command. */
if (rl_end == 0)
{
- wmove (w, TUI_CMD_WIN->detail.command_info.cur_line, 0);
+ wmove (w, getcury (w), 0);
/* Clear the line. This will blink the gdb prompt since
it will be redrawn at the same line. */
/* Move cursor to the end of the command line before emitting the
newline. We need to do so because when ncurses outputs a newline
it truncates any text that appears past the end of the cursor. */
- int px = TUI_CMD_WIN->detail.command_info.curch;
- int py = TUI_CMD_WIN->detail.command_info.cur_line;
+ int px, py;
+ getyx (w, py, px);
px += rl_end - rl_point;
py += px / TUI_CMD_WIN->generic.width;
px %= TUI_CMD_WIN->generic.width;
/* Handle prev/next/up/down here. */
ch = tui_dispatch_ctrl_char (ch);
- if (ch == '\n' || ch == '\r' || ch == '\f')
- TUI_CMD_WIN->detail.command_info.curch = 0;
if (ch == KEY_BACKSPACE)
return '\b';
tui_display_all_data ();
break;
case CMD_WIN:
- win_info->detail.command_info.cur_line = 0;
- win_info->detail.command_info.curch = 0;
#ifdef HAVE_WRESIZE
wresize (TUI_CMD_WIN->generic.handle,
TUI_CMD_WIN->generic.height,
mvwin (TUI_CMD_WIN->generic.handle,
TUI_CMD_WIN->generic.origin.y,
TUI_CMD_WIN->generic.origin.x);
- wmove (win_info->generic.handle,
- win_info->detail.command_info.cur_line,
- win_info->detail.command_info.curch);
+ wmove (win_info->generic.handle, 0, 0);
break;
default:
break;