| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Editra
Revision: 56101
Author: CJP
Date: 05 Oct 2008 20:18:46
Changes:Fix some issues with changing search direction during an incremental search causing the button or command to need to be sent twice after switching.
Files:| ... | ...@@ -20,6 +20,8 @@ | |
| 20 | 20 | |
| 21 | 21 | BUG FIXES: |
| 22 | 22 | +Fix case where encoding can be None in when initializing the preference dialog |
| 23 | +Fix some issues with switching search direction | |
| 24 | +F3 causing search to skip every other match when search bar has focus | |
| 23 | 25 | |
| 24 | 26 | #-----------------------------------------------------------------------------# |
| 25 | 27 |
| ... | ...@@ -59,7 +59,7 @@ | |
| 59 | 59 | self._parent = owner |
| 60 | 60 | self._stc = getstc |
| 61 | 61 | self._finddlg = None |
| 62 | self._posinfo = dict(scroll=0, start=0, found=0) | |
| 62 | self._posinfo = dict(scroll=0, start=0, found=0, ldir=None) | |
| 63 | 63 | self._data = wx.FindReplaceData(finddlg.AFR_RECURSIVE) |
| 64 | 64 | self._li_choices = list() |
| 65 | 65 | self._li_sel = 0 |
| ... | ...@@ -189,11 +189,24 @@ | |
| 189 | 189 | isdown, evt.IsMatchCase(), evt.IsWholeWord()) |
| 190 | 190 | engine.SetSearchPool(stc.GetTextRaw()) |
| 191 | 191 | |
| 192 | # Check if the direction changed | |
| 193 | ldir = self._posinfo['ldir'] | |
| 194 | if isdown: | |
| 195 | self._posinfo['ldir'] = 'down' | |
| 196 | else: | |
| 197 | self._posinfo['ldir'] = 'up' | |
| 198 | ||
| 192 | 199 | # Get the search start position |
| 193 | 200 | if evt.GetEventType() == finddlg.edEVT_FIND: |
| 194 | 201 | spos = self._posinfo['found'] |
| 195 | 202 | else: |
| 196 | 203 | spos = stc.GetCurrentPos() |
| 204 | if ldir != self._posinfo['ldir']: | |
| 205 | start, end = stc.GetSelection() | |
| 206 | if ldir == 'down': | |
| 207 | spos = start | |
| 208 | else: | |
| 209 | spos = end | |
| 197 | 210 | |
| 198 | 211 | # Do the find |
| 199 | 212 | match = engine.Find(spos) |