6914
6914
oldLevel = len(at.thinNodeStack)
6915
6915
newLevel = at.endSentinelLevelStack.pop()
6916
6916
at.changeLevel(oldLevel,newLevel)
6917
#@+node:ekr.20110611113007.6600: *3* Fixed bug: Wrap-around search now restart when find pattern changes
6920
This was an ancient bug.
6921
#@+node:ekr.20031218072017.1460: *4* update_ivars (leoFind)
6922
# New in Leo 4.4.3: This is now gui-independent code.
6924
def update_ivars (self):
6926
"""Called just before doing a find to update ivars from the find panel."""
6928
trace = False and not g.unitTesting
6933
for key in self.intKeys:
6934
val = self.svarDict[key].get()
6935
# if trace: g.trace(self.svarDict.get(key),val)
6936
setattr(self, key, val) # No more _flag hack.
6938
# Set ivars from radio buttons. Convert these to 1 or 0.
6939
search_scope = self.svarDict["radio-search-scope"].get()
6940
# g.trace('radio-search-scope',search_scope)
6941
self.suboutline_only = g.choose(search_scope == "suboutline-only",1,0)
6942
self.node_only = g.choose(search_scope == "node-only",1,0)
6943
self.selection = g.choose(search_scope == "selection-only",1,0)
6945
# New in 4.3: The caller is responsible for removing most trailing cruft.
6946
# Among other things, this allows Leo to search for a single trailing space.
6947
s = self.find_ctrl.getAllText()
6949
if trace: g.trace('find',repr(s),self.find_ctrl)
6950
if s and s[-1] in ('\r','\n'):
6953
# 2011/06/13: clear wrap_pos if the find_text changes.
6954
if s != self.find_text:
6955
# g.trace('clearing self.wrap_pos')
6956
self.wrapPosition = None
6959
s = self.change_ctrl.getAllText()
6960
if s and s[-1] in ('\r','\n'):
6963
self.change_text = s
6964
if trace: g.trace('change',repr(s))
6919
6967
# Put this @language after the @all as a kind of permanent unit test.