~gcrosswhite/leo-editor/scala-colorizer-patch

« back to all changes in this revision

Viewing changes to leo/core/leoProjects.txt

  • Committer: Edward K. Ream
  • Date: 2011-06-13 14:00:32 UTC
  • Revision ID: edreamleo@gmail.com-20110613140032-3snllzvu0hg8e7vw
Fixed ancient bug: wrap-around searches should reset when the find-pattern changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
6918
@nocolor-node
 
6919
 
 
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.
 
6923
 
 
6924
def update_ivars (self):
 
6925
 
 
6926
    """Called just before doing a find to update ivars from the find panel."""
 
6927
 
 
6928
    trace = False and not g.unitTesting
 
6929
 
 
6930
    self.p = self.c.p
 
6931
    self.v = self.p.v
 
6932
 
 
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.
 
6937
 
 
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)
 
6944
 
 
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()
 
6948
    s = g.toUnicode(s)
 
6949
    if trace: g.trace('find',repr(s),self.find_ctrl)
 
6950
    if s and s[-1] in ('\r','\n'):
 
6951
        s = s[:-1]
 
6952
        
 
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
 
6957
    self.find_text = s
 
6958
 
 
6959
    s = self.change_ctrl.getAllText()
 
6960
    if s and s[-1] in ('\r','\n'):
 
6961
        s = s[:-1]
 
6962
    s = g.toUnicode(s)
 
6963
    self.change_text = s
 
6964
    if trace: g.trace('change',repr(s))
6917
6965
#@-all
6918
6966
 
6919
6967
# Put this @language after the @all as a kind of permanent unit test.