diff --git a/uppsrc/CodeEditor/CodeEditor.h b/uppsrc/CodeEditor/CodeEditor.h index 5d53cca5b..fb0ead536 100644 --- a/uppsrc/CodeEditor/CodeEditor.h +++ b/uppsrc/CodeEditor/CodeEditor.h @@ -163,6 +163,7 @@ struct FindReplaceDlg : FrameBottom< WithIDEFindReplaceLayout > { virtual bool Key(dword key, int count); void Setup(bool doreplace); void Sync(); + bool IsIncremental() const { return incremental.IsEnabled() && incremental; } typedef FindReplaceDlg CLASSNAME; @@ -368,6 +369,7 @@ public: bool FindString(bool back); bool FindLangString(bool back); void Replace(); + void ReplaceAll(bool rest); int BlockReplace(); void MakeTabsOrSpaces(bool tabs); diff --git a/uppsrc/CodeEditor/CodeEditor.iml b/uppsrc/CodeEditor/CodeEditor.iml index 8a7a1f890..c9f218dcc 100644 --- a/uppsrc/CodeEditor/CodeEditor.iml +++ b/uppsrc/CodeEditor/CodeEditor.iml @@ -1,5 +1,7 @@ PREMULTIPLIED IMAGE_ID(Cancel) +IMAGE_ID(ReplaceRest) +IMAGE_ID(ReplaceAll) IMAGE_ID(Replace) IMAGE_ID(Breakpoint) IMAGE_ID(InvalidBreakpoint) @@ -7,44 +9,59 @@ IMAGE_ID(CondBreakpoint) IMAGE_ID(I) IMAGE_BEGIN_DATA -IMAGE_DATA(120,156,237,150,95,76,83,119,20,199,127,87,160,165,80,10,213,85,42,83,168,8,150,33,206,50,65,16,112,76,193,63) -IMAGE_DATA(15,146,22,132,42,27,96,193,63,56,197,105,22,249,51,231,86,16,144,198,108,9,110,123,113,201,226,195,204,146,237,133) -IMAGE_DATA(100,102,47,203,50,201,18,95,182,7,209,184,204,197,41,100,113,171,68,165,237,109,93,221,109,185,223,221,223,29,183,180) -IMAGE_DATA(151,22,204,194,30,150,236,52,167,247,215,223,249,156,243,59,191,115,78,155,18,13,209,16,73,116,9,138,116,52,88,49) -IMAGE_DATA(109,174,195,187,154,101,14,18,67,206,164,44,59,55,109,174,5,234,173,88,174,80,232,81,83,3,223,197,119,130,158,11) -IMAGE_DATA(221,28,218,218,208,149,172,61,43,247,233,84,47,237,163,54,207,112,55,247,228,226,153,32,118,215,224,201,230,82,184,14) -IMAGE_DATA(109,231,188,7,183,97,114,224,40,139,198,87,113,74,149,218,47,249,188,169,214,246,225,64,27,38,7,59,88,223,193,42) -IMAGE_DATA(76,29,216,206,249,54,21,161,59,73,227,192,230,98,56,219,182,179,190,214,109,120,240,246,1,22,205,205,232,74,89,230) -IMAGE_DATA(232,76,214,58,232,57,147,246,195,130,109,43,156,251,171,88,148,22,161,71,165,17,239,115,34,81,115,22,37,27,225,108) -IMAGE_DATA(122,133,245,182,84,194,213,99,227,248,163,135,193,31,57,4,215,91,173,156,175,185,18,191,55,190,204,162,112,3,78,42) -IMAGE_DATA(53,3,225,119,232,72,212,244,79,23,153,240,104,239,22,206,99,45,3,123,196,194,179,175,91,120,119,67,57,30,54,84) -IMAGE_DATA(112,1,211,6,28,151,249,132,124,149,41,142,169,194,2,184,235,202,121,183,165,20,110,115,41,60,245,101,188,123,211,139) -IMAGE_DATA(130,79,202,249,88,181,62,154,170,115,184,119,85,83,158,119,237,46,134,168,230,18,222,179,107,27,58,82,117,81,253,90) -IMAGE_DATA(213,105,125,126,171,21,83,54,51,231,169,54,193,179,227,37,158,170,91,88,211,61,95,109,29,108,202,148,136,30,53,39) -IMAGE_DATA(105,250,158,88,247,98,114,127,29,235,45,203,199,163,138,245,220,253,117,70,80,165,107,111,69,1,156,205,22,214,189,219) -IMAGE_DATA(12,129,21,123,212,162,78,61,55,85,91,143,201,198,90,150,53,25,225,44,202,103,239,231,228,160,85,169,62,111,19,148) -IMAGE_DATA(174,157,27,243,89,111,161,17,15,26,45,236,99,129,21,124,134,198,74,202,225,181,214,113,236,218,108,60,88,151,199,78) -IMAGE_DATA(100,26,176,79,145,20,170,219,94,69,210,89,186,71,109,94,99,142,200,142,149,150,227,135,53,121,240,231,229,7,31,103) -IMAGE_DATA(231,114,63,103,100,162,94,145,56,167,214,123,20,137,253,212,70,25,202,82,159,52,134,209,127,151,150,142,111,210,150,163) -IMAGE_DATA(62,65,25,115,174,247,36,40,135,40,67,89,45,179,100,5,9,255,114,252,235,178,132,40,73,34,209,205,217,103,4,11) -IMAGE_DATA(125,143,33,201,102,117,223,202,11,171,111,51,57,76,117,132,215,236,42,110,142,211,122,210,210,122,171,29,251,254,104,65) -IMAGE_DATA(242,229,84,55,41,142,107,154,57,135,144,42,50,64,86,144,194,176,56,127,199,202,36,91,45,215,246,112,237,254,19,88) -IMAGE_DATA(117,39,231,233,170,187,185,96,78,171,198,168,41,110,127,194,231,29,227,91,240,66,127,214,183,194,71,181,200,199,49,113) -IMAGE_DATA(100,57,41,216,250,117,85,224,228,159,167,160,189,153,17,204,252,41,55,160,250,68,235,33,58,38,55,254,136,234,203,174) -IMAGE_DATA(9,35,62,157,206,156,118,176,213,208,159,78,191,42,84,64,43,100,155,104,252,34,31,3,79,237,65,221,173,12,222,112) -IMAGE_DATA(39,47,144,60,162,3,209,19,147,24,214,170,252,224,216,47,233,248,208,151,49,221,229,76,15,244,184,171,160,123,35,237) -IMAGE_DATA(74,234,123,122,231,71,254,193,96,250,173,231,248,236,241,124,104,174,232,65,12,164,50,226,222,53,241,239,183,220,214,163) -IMAGE_DATA(215,189,26,237,206,140,64,243,120,5,134,30,117,6,139,239,26,96,188,151,135,165,87,87,129,108,98,218,35,106,200,204) -IMAGE_DATA(60,45,241,195,181,55,51,112,236,97,22,154,126,93,27,168,190,107,224,11,239,229,240,207,127,111,0,217,201,12,70,176) -IMAGE_DATA(242,22,214,197,95,216,121,99,37,172,191,173,193,142,137,92,46,247,198,106,144,134,248,143,231,241,153,221,123,45,225,242) -IMAGE_DATA(150,177,44,20,255,152,13,198,166,248,44,172,159,177,102,34,180,159,112,92,245,85,124,183,234,154,176,163,88,192,39,82) -IMAGE_DATA(150,8,124,92,200,39,186,168,133,23,236,81,77,180,232,144,105,101,44,206,100,50,97,120,120,24,215,5,21,64,140,8) -IMAGE_DATA(207,24,126,232,233,233,17,57,191,94,47,178,225,106,183,217,36,31,49,54,141,75,89,183,240,148,179,146,134,157,33,230) -IMAGE_DATA(16,45,110,196,25,97,119,146,242,93,72,37,254,89,216,75,97,252,200,2,241,93,130,218,100,119,136,197,78,204,196,54) -IMAGE_DATA(68,214,84,172,89,180,184,148,61,57,27,123,78,95,237,97,249,218,102,227,206,219,231,121,231,97,177,135,105,116,116,84) -IMAGE_DATA(212,225,133,134,233,250,117,248,253,126,200,197,110,183,207,29,166,24,172,36,225,141,16,135,105,134,237,237,237,133,203,229) -IMAGE_DATA(18,149,174,67,103,100,101,133,114,163,185,74,34,113,146,95,148,51,158,137,191,84,89,25,226,105,62,146,68,203,199,53) -IMAGE_DATA(62,62,119,152,98,8,101,105,108,131,124,152,132,154,197,98,231,27,38,219,204,125,122,23,117,152,102,143,146,195,11,170) -IMAGE_DATA(52,60,243,41,136,172,25,180,94,243,104,175,44,254,255,252,226,241,210,231,133,244,159,204,130,240,151,68,37,255,101,138) -IMAGE_DATA(6,202,37,218,222,127,197,22,245,126,127,1,22,46,19,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) -IMAGE_END_DATA(1280, 6) +IMAGE_DATA(120,156,237,86,123,80,91,101,22,255,2,228,73,72,8,24,72,129,66,64,40,44,165,109,192,242,176,47,44,143,182,42) +IMAGE_DATA(200,59,165,90,104,160,42,221,218,215,236,72,139,138,6,10,180,140,218,74,107,125,212,234,58,59,219,213,217,215,116,87) +IMAGE_DATA(103,103,213,81,91,157,250,71,117,198,98,173,182,104,121,140,163,6,42,37,201,77,42,154,132,251,219,123,179,36,228,117) +IMAGE_DATA(19,198,169,238,236,140,39,115,146,239,126,231,119,206,247,157,199,47,9,145,17,25,113,137,146,47,136,71,131,22,51,85) +IMAGE_DATA(181,120,76,22,219,79,56,164,51,42,246,192,76,85,13,80,175,69,156,64,160,66,101,37,172,199,31,117,152,143,236,179) +IMAGE_DATA(161,181,21,123,35,21,251,125,125,218,165,49,221,172,205,60,176,207,118,253,120,167,3,21,149,184,126,107,17,140,247,149) +IMAGE_DATA(219,44,247,150,96,162,119,59,133,77,119,227,65,177,188,199,229,243,59,169,162,27,91,91,49,209,183,131,178,222,91,138) +IMAGE_DATA(169,173,229,54,107,193,114,236,147,200,250,113,107,62,12,173,229,148,181,165,4,227,143,108,165,208,212,132,189,81,177,253) +IMAGE_DATA(237,145,138,126,246,156,9,253,253,140,109,45,12,91,74,41,20,45,71,135,88,230,204,103,183,72,182,31,133,183,192,176) +IMAGE_DATA(249,54,202,210,92,12,99,135,206,70,111,191,31,244,182,251,96,124,168,197,102,109,42,198,183,155,214,80,200,93,134,61) +IMAGE_DATA(66,89,175,103,14,59,68,178,158,153,229,26,76,110,92,109,51,107,87,128,218,86,77,83,191,173,166,77,13,43,241,93) +IMAGE_DATA(195,42,155,93,179,12,59,125,124,220,190,194,168,254,169,220,28,152,106,87,210,166,234,34,152,170,138,96,174,95,65,155) +IMAGE_DATA(10,150,50,62,81,143,115,213,122,187,92,217,111,218,80,198,226,105,99,69,62,156,90,85,72,155,55,148,96,135,92,25) +IMAGE_DATA(208,175,69,26,221,61,173,213,98,74,87,101,51,151,105,96,94,151,71,179,106,98,214,236,158,181,166,22,58,97,148,87) +IMAGE_DATA(143,154,36,178,238,235,218,141,152,216,82,75,89,86,100,99,114,213,18,219,215,139,51,193,42,187,182,172,202,129,161,169) +IMAGE_DATA(154,50,85,84,129,193,58,123,212,44,149,31,152,170,169,199,196,166,26,138,210,100,194,176,60,155,250,58,61,29,45,66) +IMAGE_DATA(233,227,58,70,217,181,225,150,108,202,146,155,137,241,77,213,212,53,6,203,248,28,28,44,92,9,139,182,214,70,45,74) +IMAGE_DATA(195,248,226,44,106,44,89,141,70,129,196,93,183,141,2,201,126,118,143,181,89,50,211,157,216,193,162,149,248,232,230,44) +IMAGE_DATA(76,103,101,59,174,165,101,216,134,18,146,81,47,16,249,213,186,78,32,234,97,109,44,134,197,178,62,209,60,158,234,253) +IMAGE_DATA(232,120,188,29,29,135,122,190,144,115,174,235,248,194,131,44,134,197,42,120,97,11,136,39,57,126,118,9,35,66,34,34) +IMAGE_DATA(74,191,125,30,99,97,223,57,36,178,74,218,157,116,36,245,50,47,157,87,230,229,53,183,10,247,115,90,66,154,91,46) +IMAGE_DATA(182,161,241,251,102,68,158,148,155,72,126,248,230,217,115,8,41,37,189,100,1,201,245,136,243,223,88,201,100,109,245,7) +IMAGE_DATA(117,182,182,233,221,88,248,101,250,15,11,135,51,192,123,88,60,200,154,194,183,240,255,188,99,116,53,126,211,147,242,46) +IMAGE_DATA(243,40,117,226,195,121,225,36,142,228,172,125,171,212,190,231,199,7,161,184,144,224,72,190,148,97,23,191,164,48,19,37) +IMAGE_DATA(47,35,98,155,248,181,189,99,153,248,227,76,242,76,63,85,6,213,195,241,167,153,10,40,152,219,138,50,255,146,13,197) +IMAGE_DATA(61,127,160,133,141,207,211,162,198,227,180,160,254,57,90,176,254,217,73,103,88,173,240,232,3,87,226,241,180,53,97,102) +IMAGE_DATA(175,33,222,222,97,42,133,114,87,244,235,242,39,85,134,99,211,125,142,155,6,202,232,93,87,172,40,57,125,21,37,103) +IMAGE_DATA(167,64,82,235,254,234,206,187,50,226,80,243,101,21,186,76,169,104,51,36,216,155,70,87,225,224,100,187,35,127,88,141) +IMAGE_DATA(164,103,42,105,237,160,9,57,127,255,6,75,254,57,14,162,158,245,227,205,230,95,29,49,80,115,33,1,15,124,151,130) +IMAGE_DATA(205,95,45,178,231,28,205,163,213,199,110,167,19,15,63,69,175,121,123,2,234,223,143,32,241,196,40,248,101,79,124,30) +IMAGE_DATA(22,175,209,123,181,176,54,226,200,250,79,146,160,253,230,102,44,123,113,169,35,109,224,77,58,253,31,19,72,58,62,140) +IMAGE_DATA(216,67,67,144,29,188,12,137,254,18,196,165,39,76,126,253,187,135,127,114,245,96,10,242,63,75,3,217,16,123,38,106) +IMAGE_DATA(243,11,87,228,135,71,32,233,102,240,221,67,16,228,61,250,5,9,143,188,61,80,239,249,59,197,255,138,216,39,254,128) +IMAGE_DATA(217,17,144,8,89,165,168,249,111,87,37,7,70,32,92,247,220,56,9,139,172,224,154,41,102,18,4,76,31,4,238,103) +IMAGE_DATA(201,130,86,126,126,231,16,225,71,215,187,247,98,126,73,114,248,10,67,150,232,212,180,93,183,237,222,255,78,152,80,82) +IMAGE_DATA(192,137,11,65,30,233,186,164,87,79,124,124,193,254,134,217,142,59,244,79,159,35,17,162,188,128,81,230,86,126,100,226) +IMAGE_DATA(47,137,61,124,244,253,179,244,201,73,27,58,199,190,199,243,87,109,200,111,235,121,143,132,11,243,60,252,130,146,75,184) +IMAGE_DATA(40,177,247,137,179,131,244,159,174,253,136,93,151,45,216,254,169,25,91,152,97,108,31,178,160,240,161,87,70,120,226,152) +IMAGE_DATA(187,92,161,130,145,109,233,129,59,103,26,94,107,199,154,87,159,165,59,71,174,163,241,220,53,212,157,155,130,178,249,153) +IMAGE_DATA(75,209,89,5,250,176,168,132,38,22,30,138,124,189,63,232,29,202,139,9,180,234,216,93,14,78,50,145,208,100,140,191) +IMAGE_DATA(120,19,157,54,154,13,121,87,121,96,114,121,74,16,114,38,30,45,132,162,175,28,113,59,251,135,3,145,141,39,138,107) +IMAGE_DATA(154,173,104,64,178,150,13,171,233,220,145,116,58,246,208,98,164,244,253,219,202,69,62,158,32,102,163,95,243,61,200,187) +IMAGE_DATA(110,44,195,150,241,73,42,72,67,196,11,132,47,175,152,7,25,189,231,199,131,204,60,157,224,21,247,60,205,159,156,129) +IMAGE_DATA(201,237,105,11,68,214,96,226,75,246,249,200,175,191,140,255,187,95,70,23,57,213,95,102,217,35,79,41,65,84,68,227) +IMAGE_DATA(12,59,79,50,202,94,87,49,4,36,197,94,121,7,33,95,230,72,22,98,78,47,4,41,224,181,121,213,48,4,217,18) +IMAGE_DATA(63,84,131,172,231,245,121,97,125,91,200,69,46,110,159,208,100,226,158,137,208,228,9,37,243,33,139,148,121,65,31,208) +IMAGE_DATA(196,22,29,62,90,204,133,211,104,52,24,24,24,192,121,70,25,32,78,49,159,28,126,232,232,232,112,226,166,85,42,39) +IMAGE_DATA(214,83,245,58,157,203,199,25,155,141,203,98,77,204,167,47,214,165,30,103,56,239,16,40,174,215,25,30,57,185,238,27) +IMAGE_DATA(74,93,248,249,96,95,246,192,159,10,17,223,200,168,206,39,7,46,236,216,108,108,181,119,77,157,53,11,20,151,197,238) +IMAGE_DATA(153,139,237,215,87,189,199,125,117,115,113,131,246,57,232,60,220,232,97,58,115,230,140,83,7,66,13,211,249,243,152,158) +IMAGE_DATA(158,134,175,232,245,122,255,97,226,192,186,196,179,17,206,97,154,197,118,117,117,193,104,52,58,149,93,187,207,72,73,113) +IMAGE_DATA(223,141,189,171,75,92,56,151,95,128,51,230,133,127,185,184,216,141,103,239,227,146,64,247,49,142,142,250,15,19,135,176) +IMAGE_DATA(88,54,182,218,119,152,152,154,113,97,131,13,147,110,54,159,174,27,58,76,115,71,249,130,67,170,107,120,130,41,136,79) +IMAGE_DATA(51,216,122,5,209,46,159,248,191,226,111,28,222,245,28,74,127,202,44,48,127,73,196,190,223,76,129,128,190,18,104,239) +IMAGE_DATA(255,197,22,48,191,255,0,24,19,205,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(1760, 8) diff --git a/uppsrc/CodeEditor/CodeEditor.lay b/uppsrc/CodeEditor/CodeEditor.lay index fb2ba3750..770a238fb 100644 --- a/uppsrc/CodeEditor/CodeEditor.lay +++ b/uppsrc/CodeEditor/CodeEditor.lay @@ -13,7 +13,9 @@ LAYOUT(IDEFindReplaceLayout, 756, 52) ITEM(Option, incremental_from_cursor, SetLabel(t_("from cursor")).LeftPosZ(648, 92).TopPosZ(4, 19)) ITEM(Button, close, RightPosZ(4, 20).TopPosZ(4, 19)) ITEM(Button, amend, LeftPosZ(212, 20).TopPosZ(28, 19)) - ITEM(Option, samecase, SetLabel(t_("Mimic case")).LeftPosZ(256, 108).TopPosZ(28, 19)) + ITEM(Button, amend_all, SetLabel(t_("All")).LeftPosZ(236, 44).TopPosZ(28, 19)) + ITEM(Button, amend_rest, SetLabel(t_("Rest")).LeftPosZ(284, 52).TopPosZ(28, 19)) + ITEM(Option, samecase, SetLabel(t_("Mimic case")).LeftPosZ(424, 108).TopPosZ(28, 19)) ITEM(Switch, mode, SetLabel(t_("Replace\nRemove lines without pattern\nRemove line with pattern")).LeftPosZ(0, 408).TopPosZ(64, 16)) END_LAYOUT diff --git a/uppsrc/CodeEditor/FindReplace.cpp b/uppsrc/CodeEditor/FindReplace.cpp index 0a0344c0c..854682738 100644 --- a/uppsrc/CodeEditor/FindReplace.cpp +++ b/uppsrc/CodeEditor/FindReplace.cpp @@ -11,6 +11,8 @@ void CodeEditor::InitFindReplace() PutI(findreplace.find); PutI(findreplace.replace); findreplace.amend <<= THISBACK(Replace); + findreplace.amend_all <<= THISBACK1(ReplaceAll, false); + findreplace.amend_rest <<= THISBACK1(ReplaceAll, true); findreplace.prev <<= THISBACK(DoFindBack); findreplace.replacing = false; found = notfoundfw = notfoundbk = foundsel = false; @@ -28,6 +30,8 @@ FindReplaceDlg::FindReplaceDlg() close.Cancel(); prev.SetImage(CtrlImg::SmallUp()); amend.SetImage(CodeEditorImg::Replace()); + amend_all.SetImage(CodeEditorImg::ReplaceAll()); + amend_rest.SetImage(CodeEditorImg::ReplaceRest()); incremental <<= true; mode <<= THISBACK(Sync); mode.Hide(); @@ -42,7 +46,7 @@ void FindReplaceDlg::Sync() prev.Enable(b); ignorecase.Enable(b); wholeword.Enable(b); - incremental_from_cursor.Enable(incremental); + incremental_from_cursor.Enable(IsIncremental()); b = !mode.IsVisible() || ~mode == 0; replace.Enable(b); replace_txt.Enable(b); @@ -99,6 +103,8 @@ void FindReplaceDlg::Setup(bool doreplace) replacing = doreplace; replace.Show(replacing); amend.Show(replacing); + amend_all.Show(replacing); + amend_rest.Show(replacing); Height(doreplace ? GetLayoutSize().cy : replace.GetRect().top); SetFrame(TopSeparatorFrame()); Sync(); @@ -346,7 +352,7 @@ void CodeEditor::NotFound() { findreplace.find.Error(); findreplace.info.SetLabel("Not &found"); - if(!findreplace.incremental) + if(!findreplace.IsIncremental()) SetFocus(); findreplace.amend.Disable(); } @@ -358,7 +364,7 @@ bool CodeEditor::Find(bool back, bool blockreplace, bool replace) if(!blockreplace) { if(!findreplace.IsOpen()) OpenNormalFindReplace(replace); - if(!findreplace.incremental) + if(!findreplace.IsIncremental()) SetFocus(); } return true; @@ -554,8 +560,7 @@ int CodeEditor::BlockReplace() void CodeEditor::OpenNormalFindReplace0(bool replace) { - if(GetLength() > 1000000) - findreplace.incremental <<= false; + findreplace.incremental.Enable(GetLength() < 2000000); findreplace.Setup(replace); findreplace.itext = GetI(); findreplace.prev.Show(); @@ -614,6 +619,8 @@ void CodeEditor::FindReplace(bool pick_selection, bool pick_text, bool replace) findreplace.SetRect(WithBlockReplaceLayout::GetLayoutSize()); findreplace.Title(t_("Replace in selection")); findreplace.amend.Hide(); + findreplace.amend_all.Hide(); + findreplace.amend_rest.Hide(); findreplace.prev.Hide(); findreplace.next.Ok() <<= findreplace.Breaker(IDOK); findreplace.close.Cancel() <<= findreplace.Breaker(IDCANCEL); @@ -636,6 +643,17 @@ void CodeEditor::FindReplace(bool pick_selection, bool pick_text, bool replace) } } +void CodeEditor::ReplaceAll(bool rest) +{ + int l, h; + GetSelection(l, h); + int c = min(l, h); + findreplace.mode <<= 0; + SetSelection(rest * c, GetLength()); + BlockReplace(); + SetCursor(c); +} + void CodeEditor::InsertWildcard(const char *s) { iwc = s; @@ -738,7 +756,7 @@ void CodeEditor::CloseFindReplace() void CodeEditor::EscapeFindReplace() { CloseFindReplace(); - if(ff_start_pos >= 0 && ff_start_pos < GetLength() && findreplace.incremental && do_ff_restore_pos) { + if(ff_start_pos >= 0 && ff_start_pos < GetLength() && findreplace.IsIncremental() && do_ff_restore_pos) { SetCursor(ff_start_pos); ff_start_pos = -1; } @@ -748,7 +766,7 @@ void CodeEditor::IncrementalFind() { NoFindError(); findreplace.Sync(); - if(!findreplace.incremental || findreplace.GetTopCtrl() == &findreplace) // || we are block replace + if(!findreplace.IsIncremental() || findreplace.GetTopCtrl() == &findreplace) // || we are block replace return; bool b = FindFrom(ff_start_pos >= 0 && ff_start_pos < GetLength() && findreplace.incremental_from_cursor ? ff_start_pos : 0, false, false);