I want to modify the way the standard search works.  I tried to monkey-
patch minibufferFind.generalSearchHelper via a script-button, but it
seems to have had no effect.  I can't figure out why.

I added the line "g.es('LeoPyRef generalSearchHelper')" to the normal
generalSearchHelper in LeoPyRef, so I can see it's just calling the
regular method and ignoring my monkey-patched version.  What's going
on?

Here's the button:

from leoEditCommands import minibufferFind

g.es("Test search button...")

def generalSearchHelper
(self,pattern,cloneFindAll=False,findAll=False):
    g.es("monkey patched generalSearchHelper")

# Why doesn't this work?
minibufferFind.generalSearchHelper = generalSearchHelper

# This doesn't work either
#g.funcToMethod(generalSearchHelper, minibufferFind)

# This doesn't work because minibufferFindHandler hasn't been created
yet
#c.searchCommands.minibufferFindHandler.generalSearchHelper =
generalSearchHelper

c.searchCommands.searchWithPresentOptions(None)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to