+fix: find previous skips finding at begin

This commit is contained in:
METANEOCORTEX\Kotti 2023-02-19 13:32:56 +01:00
parent 40e44f3f44
commit 5cdcddb075
2 changed files with 11 additions and 9 deletions

View File

@ -5911,7 +5911,7 @@ static DocPos _FindInTarget(LPCWSTR wchFind, int sFlags,
DocPos const len = (DocPos)WideCharToMultiByte(Encoding_SciCP, 0, wchFind, -1, chFind, COUNTOF(chFind), NULL, NULL);
iPos = SciCall_SearchInTarget(len - 1, chFind);
iPos = (bFindNext ? (iPos >= stop) : (iPos <= stop)) ? -1LL : iPos; // regex search
iPos = (bFindNext ? (iPos > stop) : (iPos < stop)) ? -1LL : iPos; // not found if beyond stop
// handle next in case of zero-length-matches (regex) !
if (iPos == start) {

View File

@ -6382,15 +6382,17 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
case IDM_SET_RENDER_TECH_D2D:
case IDM_SET_RENDER_TECH_D2DRETAIN:
case IDM_SET_RENDER_TECH_D2DDC: {
int const prevRT = Settings.RenderingTechnology;
int const prevRT = SciCall_GetTechnology();
Settings.RenderingTechnology = (iLoWParam - IDM_SET_RENDER_TECH_GDI);
SciCall_SetTechnology(Settings.RenderingTechnology);
Settings.RenderingTechnology = SciCall_GetTechnology();
int const prevBD = Settings.Bidirectional;
SciCall_SetBidirectional(Settings.Bidirectional);
Settings.Bidirectional = SciCall_GetBidirectional();
if (prevRT != Settings.RenderingTechnology) {
SciCall_SetTechnology(Settings.RenderingTechnology);
Settings.RenderingTechnology = SciCall_GetTechnology(); // switched ?
}
int const prevBD = SciCall_GetBidirectional();
if (prevBD != Settings.Bidirectional) {
SciCall_SetBidirectional(Settings.Bidirectional);
Settings.Bidirectional = SciCall_GetBidirectional(); // switched ?
}
if ((prevRT != Settings.RenderingTechnology) || (prevBD != Settings.Bidirectional)) {
Style_ResetCurrentLexer(Globals.hwndEdit);
}