/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.309 2020/05/27 23:56:32 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.311 2021/08/16 21:51:11 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
****************************************************************************/
static void
-position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend)
+position_check(NCURSES_SP_DCLx int expected_y, int expected_x, const char *legend)
/* check to see if the real cursor position matches the virtual */
{
char buf[20];
/* we can put the char directly */
PutAttrChar(NCURSES_SP_ARGx ch);
} else if (enter_am_mode && exit_am_mode) {
+ int oldcol = SP_PARM->_curscol;
/* we can suppress automargin */
NCURSES_PUTP2("exit_am_mode", exit_am_mode);
PutAttrChar(NCURSES_SP_ARGx ch);
- SP_PARM->_curscol--;
+ SP_PARM->_curscol = oldcol;
position_check(NCURSES_SP_ARGx
SP_PARM->_cursrow,
SP_PARM->_curscol,
newPair = GetPair(newLine[n]);
if (oldPair != newPair
&& unColor(oldLine[n]) == unColor(newLine[n])) {
- if (oldPair < SP_PARM->_pair_limit
- && newPair < SP_PARM->_pair_limit
+ if (oldPair < SP_PARM->_pair_alloc
+ && newPair < SP_PARM->_pair_alloc
&& (isSamePair(SP_PARM->_color_pairs[oldPair],
SP_PARM->_color_pairs[newPair]))) {
SetPair(oldLine[n], GetPair(newLine[n]));