Compare commits

..

No commits in common. "8d9d1c60ecf2e757731ae03c045b7ea905732905" and "fcd1b8e0110182bbb53a5b9a2e797f6ec1e1657e" have entirely different histories.

View File

@ -848,7 +848,7 @@ relay_process_message(const Relay::EventMessage &m)
{
auto pong = new Relay::CommandData_PingResponse();
pong->event_seq = m.event_seq;
relay_send_now(pong);
relay_send(pong);
break;
}
@ -1301,32 +1301,6 @@ input_complete()
return true;
}
static bool
input_up()
{
auto b = buffer_by_name(g.buffer_current);
if (!b || b->history_at < 1)
return false;
if (b->history_at == b->history.size())
b->input = window_get_text(g.hwndInput);
input_set_contents(b->history.at(--b->history_at));
return true;
}
static bool
input_down()
{
auto b = buffer_by_name(g.buffer_current);
if (!b || b->history_at >= b->history.size())
return false;
input_set_contents(++b->history_at == b->history.size()
? b->input
: b->history.at(b->history_at));
return true;
}
static boolean
input_wants(const MSG *message)
{
@ -1358,18 +1332,34 @@ input_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
return lResult;
}
case WM_SYSCHAR:
{
auto b = buffer_by_name(g.buffer_current);
if (!b)
break;
// TODO(p): Emacs-style cursor movement shortcuts.
switch (wParam) {
case 'p':
if (input_up())
return 0;
break;
{
if (b->history_at < 1)
break;
if (b->history_at == b->history.size())
b->input = window_get_text(g.hwndInput);
input_set_contents(b->history.at(--b->history_at));
return 0;
}
case 'n':
if (input_down())
return 0;
break;
{
if (b->history_at >= b->history.size())
break;
input_set_contents(++b->history_at == b->history.size()
? b->input
: b->history.at(b->history_at));
return 0;
}
}
break;
}
case WM_KEYDOWN:
{
HWND scrollable = IsWindowVisible(g.hwndBufferLog)
@ -1377,14 +1367,6 @@ input_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
: g.hwndBuffer;
switch (wParam) {
case VK_UP:
if (input_up())
return 0;
break;
case VK_DOWN:
if (input_down())
return 0;
break;
case VK_PRIOR:
SendMessage(scrollable, EM_SCROLL, SB_PAGEUP, 0);
return 0;