mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-22 13:35:03 -05:00
Scroll the event log to the end after adding a line if it was looking at the
end before the line was added. [originally from svn r2879]
This commit is contained in:
parent
eec4b9d08d
commit
791a12ce5b
@ -1,4 +1,4 @@
|
|||||||
/* $Id: macevlog.c,v 1.3 2003/02/19 01:03:47 ben Exp $ */
|
/* $Id: macevlog.c,v 1.4 2003/02/23 12:41:44 ben Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003 Ben Harris
|
* Copyright (c) 2003 Ben Harris
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -110,7 +110,7 @@ void logevent(void *frontend, char *str)
|
|||||||
{
|
{
|
||||||
Terminal *term = frontend;
|
Terminal *term = frontend;
|
||||||
Session *s = term->frontend;
|
Session *s = term->frontend;
|
||||||
ListBounds bounds;
|
ListBounds bounds, visible;
|
||||||
Cell cell = { 0, 0 };
|
Cell cell = { 0, 0 };
|
||||||
|
|
||||||
if (s->eventlog == NULL)
|
if (s->eventlog == NULL)
|
||||||
@ -120,12 +120,18 @@ void logevent(void *frontend, char *str)
|
|||||||
|
|
||||||
#if TARGET_API_MAC_CARBON
|
#if TARGET_API_MAC_CARBON
|
||||||
GetListDataBounds(s->eventlog, &bounds);
|
GetListDataBounds(s->eventlog, &bounds);
|
||||||
|
GetListVisibleCells(s->eventlog, &visible);
|
||||||
#else
|
#else
|
||||||
bounds = (*s->eventlog)->dataBounds;
|
bounds = (*s->eventlog)->dataBounds;
|
||||||
|
visible = (*s->eventlog)->visible;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cell.v = bounds.bottom;
|
cell.v = bounds.bottom;
|
||||||
LAddRow(1, cell.v, s->eventlog);
|
LAddRow(1, cell.v, s->eventlog);
|
||||||
LSetCell(str, strlen(str), cell, s->eventlog);
|
LSetCell(str, strlen(str), cell, s->eventlog);
|
||||||
|
/* ">=" and "2" because there can be a blank cell below the last one. */
|
||||||
|
if (visible.bottom >= bounds.bottom)
|
||||||
|
LScroll(0, 2, s->eventlog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mac_draweventloggrowicon(Session *s)
|
static void mac_draweventloggrowicon(Session *s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user