Scroll log window after appending text

- Automatic scroll sometimes does not appear to work as expected.
  Add an explicit command to scroll to current selection.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/608/head
Selva Nair 2023-02-04 15:30:21 -05:00
parent 4085f259a6
commit 9a1e6b08c6
1 changed files with 3 additions and 0 deletions

View File

@ -219,6 +219,9 @@ OnLogLine(connection_t *c, char *line)
SendMessage(logWnd, EM_REPLACESEL, FALSE, (LPARAM) datetime); SendMessage(logWnd, EM_REPLACESEL, FALSE, (LPARAM) datetime);
SendMessage(logWnd, EM_SETTEXTEX, (WPARAM) &ste, (LPARAM) message); SendMessage(logWnd, EM_SETTEXTEX, (WPARAM) &ste, (LPARAM) message);
SendMessage(logWnd, EM_REPLACESEL, FALSE, (LPARAM) _T("\n")); SendMessage(logWnd, EM_REPLACESEL, FALSE, (LPARAM) _T("\n"));
/* scroll to the caret */
SendMessage(logWnd, EM_SCROLLCARET, 0, 0);
} }
/* expect ipv4,remote,port,,,ipv6 */ /* expect ipv4,remote,port,,,ipv6 */