From 14ab56b09fdb06bc0d93028799066ecaa942ca09 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 8 Nov 2019 22:17:29 +0300 Subject: tabSRMM: tab autocomplete shall restore original cursor position if nothing is found --- plugins/TabSRMM/src/msgdlgother.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/TabSRMM') diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 05517ae407..72fcc8ca6a 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1706,6 +1706,7 @@ bool CMsgDialog::TabAutoComplete() { LRESULT lResult = m_message.SendMsg(EM_GETSEL, 0, 0); int start = LOWORD(lResult), end = HIWORD(lResult); + int origStart = start, origEnd = end; m_message.SendMsg(EM_SETSEL, end, end); GETTEXTEX gt = { 0 }; @@ -1786,6 +1787,7 @@ LBL_SkipEnd: m_message.SendMsg(EM_SETSEL, start, end); m_message.SendMsg(EM_REPLACESEL, TRUE, (LPARAM)m_wszSearchQuery); } + m_message.SendMsg(EM_SETSEL, origStart, origEnd); replaceStrW(m_wszSearchQuery, nullptr); return false; } -- cgit v1.2.3