示例#1
0
文件: tty.c 项目: bloovis/micro-emacs
/*
 * High speed screen update.  row and col are 1-based.
 */
void
putline(int row, int col, const char *buf)
{
  int actual_row, actual_col;

  get_actual_pos (row - 1, col - 1, &actual_row, &actual_col);
  mvaddnstr(actual_row, actual_col, buf, ncol - col + 1);
}
示例#2
0
文件: tty.c 项目: bloovis/micro-emacs
/*
 * Move the cursor to the specified
 * origin 0 row and column position. Try to
 * optimize out extra moves; redisplay may
 * have left the cursor in the right
 * location last time!
 */
void ttmove (int row, int col)
{
  int actual_row, actual_col;

  get_actual_pos (row, col, &actual_row, &actual_col);
  move (actual_row, actual_col);
  ttrow = row;
  ttcol = col;
}
示例#3
0
文件: zsh.c 项目: rotarui/42sh
void	aff_cmpl(t_shell *shell)
{
  t_cmd	*tmp;

  tmp = shell->com.cmd_l;
  check_pos(shell);
  shell->com.y[0] = get_actual_pos(shell);
  while (tmp)
    {
      if (tmp == shell->com.cursor)
	my_dprintf(1, PINK"%s"RES"\t", tmp->str);
      else
	my_dprintf(1, "%s\t", tmp->str);
      tmp = tmp->next;
    }
  shell->com.y[1] = get_actual_pos(shell);
  gotoyx(shell, get_actual_pos(shell) + (shell->com.y[0]
					 - get_actual_pos(shell)), 0);
}
示例#4
0
文件: zsh.c 项目: rotarui/42sh
static void		check_pos(t_shell *shell)
{
  int			y;
  int			cc;
  struct winsize	ws;

  ioctl(1, TIOCGWINSZ, &ws);
  y = -1;
  cc = (count_char(&shell->com) / ws.ws_col);
  while (++y < cc)
    my_dprintf(1, "\n");
  gotoyx(shell, get_actual_pos(shell) - (1 + y), 0);
}
示例#5
0
文件: tty.c 项目: bloovis/micro-emacs
/*
 * Erase to end of line.
 */
void tteeol()
{
  if (npages > 1)
    {
      int actual_row, actual_col, i;

      get_actual_pos (ttrow, ttcol, &actual_row, &actual_col);
      for (i = ttcol; i < ncol; i++)
	addch(' ');
      move (actual_row, actual_col);
    }
  else
    clrtoeol ();
}