"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "button.c" between
xterm-363.tgz and xterm-364.tgz

About: xterm is a terminal emulator for X with ISO/ANSI color and vt220 enhancements.

button.c  (xterm-363.tgz):button.c  (xterm-364.tgz)
/* $XTermId: button.c,v 1.629 2020/12/20 17:02:30 tom Exp $ */ /* $XTermId: button.c,v 1.630 2021/01/23 00:14:49 tom Exp $ */
/* /*
* Copyright 1999-2019,2020 by Thomas E. Dickey * Copyright 1999-2020,2021 by Thomas E. Dickey
* *
* All Rights Reserved * All Rights Reserved
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, * without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
skipping to change at line 3663 skipping to change at line 3663
*/ */
static Boolean static Boolean
okPosition(TScreen *screen, okPosition(TScreen *screen,
LineData **ld, LineData **ld,
CELL *cell) CELL *cell)
{ {
Boolean result = True; Boolean result = True;
if (cell->row > screen->max_row) { if (cell->row > screen->max_row) {
result = False; result = False;
TRACE(("okPosition cell row %d > screen max %d\n", cell->row, screen->max _row));
} else if (cell->col > (LastTextCol(screen, *ld, cell->row) + 1)) { } else if (cell->col > (LastTextCol(screen, *ld, cell->row) + 1)) {
TRACE(("okPosition cell col %d > screen max %d\n", cell->col,
(LastTextCol(screen, *ld, cell->row) + 1)));
if (cell->row < screen->max_row) { if (cell->row < screen->max_row) {
TRACE(("okPosition cell row %d < screen max %d\n", cell->row, screen- >max_row));
cell->col = 0; cell->col = 0;
*ld = GET_LINEDATA(screen, ++cell->row); *ld = GET_LINEDATA(screen, ++cell->row);
result = False; result = False;
} }
} }
return result; return result;
} }
static void static void
trimLastLine(TScreen *screen, trimLastLine(TScreen *screen,
skipping to change at line 4057 skipping to change at line 4061
switch (screen->selectUnit) { switch (screen->selectUnit) {
case Select_CHAR: case Select_CHAR:
(void) okPosition(screen, &(ld.startSel), &(screen->startSel)); (void) okPosition(screen, &(ld.startSel), &(screen->startSel));
(void) okPosition(screen, &(ld.endSel), &(screen->endSel)); (void) okPosition(screen, &(ld.endSel), &(screen->endSel));
break; break;
case Select_WORD: case Select_WORD:
TRACE(("Select_WORD\n")); TRACE(("Select_WORD\n"));
if (okPosition(screen, &(ld.startSel), &(screen->startSel))) { if (okPosition(screen, &(ld.startSel), &(screen->startSel))) {
CELL mark;
cclass = CClassOf(startSel); cclass = CClassOf(startSel);
TRACE(("...starting with class %d\n", cclass));
do { do {
mark = screen->startSel;
--screen->startSel.col; --screen->startSel.col;
if (screen->startSel.col < 0 if (screen->startSel.col < 0
&& isPrevWrapped(startSel)) { && isPrevWrapped(startSel)) {
PrevRow(startSel); PrevRow(startSel);
screen->startSel.col = LastTextCol(screen, ld.startSel, scree n->startSel.row); screen->startSel.col = LastTextCol(screen, ld.startSel, scree n->startSel.row);
} }
} while (screen->startSel.col >= 0 } while (screen->startSel.col >= 0
&& CClassSelects(startSel, cclass)); && CClassSelects(startSel, cclass));
++screen->startSel.col; screen->startSel = mark;
} }
#if OPT_WIDE_CHARS #if OPT_WIDE_CHARS
if (screen->startSel.col #define SkipHiddenCell(mark) \
&& XTERM_CELL(screen->startSel.row, if (mark.col && XTERM_CELL(mark.row, mark.col) == HIDDEN_CHAR) \
screen->startSel.col) == HIDDEN_CHAR) mark.col++
screen->startSel.col++; #else
#define SkipHiddenCell(mark) /* nothing */
#endif #endif
SkipHiddenCell(screen->startSel);
screen->endSel = screen->startSel;
ld.endSel = ld.startSel;
if (okPosition(screen, &(ld.endSel), &(screen->endSel))) { if (okPosition(screen, &(ld.endSel), &(screen->endSel))) {
int length = LastTextCol(screen, ld.endSel, screen->endSel.row); int length = LastTextCol(screen, ld.endSel, screen->endSel.row);
cclass = CClassOf(endSel); cclass = CClassOf(endSel);
TRACE(("...ending with class %d\n", cclass));
do { do {
++screen->endSel.col; ++screen->endSel.col;
if (screen->endSel.col > length if (screen->endSel.col > length
&& LineTstWrapped(ld.endSel)) { && LineTstWrapped(ld.endSel)) {
if (!MoreRows(endSel)) if (!MoreRows(endSel))
break; break;
screen->endSel.col = 0; screen->endSel.col = 0;
NextRow(endSel); NextRow(endSel);
length = LastTextCol(screen, ld.endSel, screen->endSel.row); length = LastTextCol(screen, ld.endSel, screen->endSel.row);
} }
} while (screen->endSel.col <= length } while (screen->endSel.col <= length
&& CClassSelects(endSel, cclass)); && CClassSelects(endSel, cclass));
/* Word-select selects if pointing to any char in "word",
* especially note that it includes the last character in a word.
* So we do no --endSel.col and do special eol handling.
*/
if (screen->endSel.col > length + 1
&& MoreRows(endSel)) {
screen->endSel.col = 0;
NextRow(endSel);
}
} }
#if OPT_WIDE_CHARS SkipHiddenCell(screen->endSel);
if (screen->endSel.col
&& XTERM_CELL(screen->endSel.row,
screen->endSel.col) == HIDDEN_CHAR)
screen->endSel.col++;
#endif
screen->saveStartW = screen->startSel; screen->saveStartW = screen->startSel;
break; break;
case Select_LINE: case Select_LINE:
TRACE(("Select_LINE\n")); TRACE(("Select_LINE\n"));
while (LineTstWrapped(ld.endSel) while (LineTstWrapped(ld.endSel)
&& MoreRows(endSel)) { && MoreRows(endSel)) {
NextRow(endSel); NextRow(endSel);
} }
 End of changes. 14 change blocks. 
22 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)