DOH!
Google translator inserted spaces.

I thought I changed them all but missed "% TEMPFILE".
Works now, but does not update the Procedure List on the left?
Ah, I see HeXOR's code does that!!
This is super helpful. Getting closer to the Notepad++ experience.

EDIT: Only thing is the TEMP folder now holds n Copies of every file browsed during Procedure hunt!
Added the following:
EDIT2: Modified the code to catch similar Procedure names.
Code:
; kiffi, https://www.purebasic.fr/german/viewtopic.php?f=8&t=28267
; GetProcedureName
; REV: 190606, skywalk
; Modified to catch similarly named Procedures in ListBox.
; Ex. ShowIt() and ShowIt2().
;#################################################################
; Tool arguments: "%TEMPFILE"
;#################################################################
EnableExplicit
Global.s FilePath$
Procedure.s RemoveLeadingWhitespaceFromString(InString.s)
While Left(InString, 1) = Chr(32) Or Left(InString, 1) = Chr(9)
InString = LTrim(InString, Chr(32))
InString = LTrim(InString, Chr(9))
Wend
ProcedureReturn InString
EndProcedure
Procedure.s GetScintillaText()
; sicro, http://www.purebasic.fr/german/viewtopic.php?p=324916#p324916
Protected ReturnValue.s
Protected File, BOM
FilePath$ = ProgramParameter(0); %TEMPFILE (file also exists if code is not saved)
File = ReadFile(#PB_Any, FilePath$, #PB_File_SharedRead)
If IsFile(File)
BOM = ReadStringFormat(File) ; Skip BOM if present
ReturnValue = ReadString(File, #PB_File_IgnoreEOL); | BOM)
CloseFile(File)
If FindString(FilePath$, "\Temp\", 1, #PB_String_NoCase)
; Only delete temp file, in case user enters wrong path in Tool options.
DeleteFile(FilePath$)
EndIf
EndIf
ProcedureReturn ReturnValue
EndProcedure
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
Procedure EnumChildProc(hWnd, *lParam)
Protected.i Count, i, Size, searchfull
Protected.s Buffer, Buffer2
Protected CName.s{128}
GetClassName_(hWnd, @CName, 128)
If CName = "ListBox"
Count = SendMessage_(hWnd, #LB_GETCOUNT, #Null, #Null)
For i = Count - 1 To 0 Step -1 ; Search bottom up to help search alphabetically.
Size = SendMessage_(hWnd, #LB_GETTEXTLEN, i, #Null)
Buffer = Space(Size + 64)
If SendMessage_(hWnd, #LB_GETTEXT, i, @Buffer)
If searchfull = 0
; Check if parameters are shown in listview
If FindString(Buffer, "(")
searchfull = 1
Else
searchfull = -1
EndIf
EndIf
If searchfull = 1
If PeekS(*lParam) = Buffer
SendMessage_(hWnd, #LB_SETCURSEL, i, #Null)
ProcedureReturn 0
EndIf
Else
Buffer2 = Trim(StringField(PeekS(*lParam), 1, "("))
;MessageRequester("IN EnumChildProc", Buffer + " = " + Buffer2)
If Buffer2 = Buffer
SendMessage_(hWnd, #LB_SETCURSEL, i, #Null)
ProcedureReturn 0
EndIf
EndIf
EndIf
Next i
EndIf
ProcedureReturn 1
EndProcedure
CompilerEndIf
CompilerIf 0
Procedure ShowIt2(Line.s)
; Dummy procedure with nearly same name.
; Cursor here did not not select correct Procedure in ListBox.
EndProcedure
CompilerEndIf
Procedure ShowIt(Line.s)
Protected.i hwnd, i
Protected.s s
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
hwnd = Val(GetEnvironmentVariable("PB_TOOL_MainWindow"))
i = FindString(Line, " ")
If i = 0
i = FindString(Line, #TAB$)
EndIf
Line = Mid(Line, i + 1)
Line = RemoveLeadingWhitespaceFromString(Line)
;MessageRequester("SHOWIT", Line)
EnumChildWindows_(hWnd, @EnumChildProc(), @Line)
CompilerDefault
;Linux / Mac?
MessageRequester("You are here:", Line)
CompilerEndSelect
EndProcedure
Define ScintillaText.s
Define CursorLine = Val(StringField(GetEnvironmentVariable("PB_TOOL_Cursor"), 1, "x"))
Define Line.s
Define LineCounter
ScintillaText = GetScintillaText()
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
#LineFeed = #CRLF$
CompilerDefault
#LineFeed = #LF$
CompilerEndSelect
If ScintillaText <> ""
For LineCounter = CursorLine To 1 Step - 1
Line = RemoveLeadingWhitespaceFromString(StringField(ScintillaText, LineCounter, #LineFeed))
;;MessageRequester("BEFORE SHOWIT", Line)
; Allow EndProcedure to trigger search.
;If Left(LCase(Line), Len("endprocedure")) = "endprocedure"
; Break
;EndIf
If Left(LCase(Line), Len("procedure")) = "procedure"
If Left(LCase(Line), Len("procedurereturn")) <> "procedurereturn"
ShowIt(Line)
Break
EndIf
EndIf
Next LineCounter
EndIf