- SetHighlightMode(pointer);
- c = GetHost(pointer);
- DoCharacterAt(c,pointer); /* MACRO */
-
- if (NotVisuallyCompatibleAttributes
- (pointer, fieldattr, oldterm)) {
- int j;
-
- j = pointer;
-
- pointer = ScreenInc(pointer);
- if (!(--columnsleft)) {
- DoARefresh();
- EmptyTerminal();
- move(ScreenLine(pointer), 0);
- columnsleft = NumberColumns;
- }
- SetHighlightMode(pointer); /* Turn on highlighting */
- while (!IsStartField(pointer) &&
- !TermIsStartField(pointer)) {
- c = GetHost(pointer);
- DoCharacterAt(c,pointer); /* MACRO */
- pointer = ScreenInc(pointer);
- if (!(--columnsleft)) {
- DoARefresh();
- EmptyTerminal();
- move(ScreenLine(pointer), 0);
- columnsleft = NumberColumns;
- /* We don't look at HaveInput here, since
- * if we leave this loop before the end of
- * the 3270 field, we could have pointer
- * higher than Highest. This would cause
- * us to end the highest "while" loop,
- * but we may, in fact, need to go around the
- * screen once again.
- */
- }
- /* The loop needs to be protected
- * from the situation where there had been only
- * one field on the Terminal, and none on the Host.
- * In this case, we have just deleted our last
- * field. Hence, the break.
- */
- if (j == pointer) {
- break;
+ if (termattr == UNDETERMINED) {
+ termattr = WhereTermAttrByte(pointer);
+ if ((termattr != 0) || TermIsStartField(0)) {
+ termattr = GetTerminal(termattr);
+ DoAttributes(termattr);
+ } else { /* Unformatted screen */
+ termattr = NORMAL;