Skip to content

[BUG] Python FunctionList absorbs next function if space after colon #16636

@pryrt

Description

@pryrt

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

Originally reported in Forum here with v8.7.7, but confirmed with simpler example in v8.8.1:

If you define a function in Python and have a trailing space after the colon :, then the next function defined in the file will not show up in the FunctionList

Steps To Reproduce

  1. Paste the following into Python file, noting there is a space after the : on the definition of func2

    def func1(a,b):
    	pass
    
    def func2(a,b): 
    	pass
    
    def func3(a,b):
    	pass
    
    def func4(a,b):
    	pass
    
  2. look at FunctionList, see the space after func2(a,b):, and see that func3(a,b) is not listed among the functions.
    Image

  3. Remove the space on the func2 definition, and see that func3 shows up.
    Image

Current Behavior

Doesn't show def func3(a,b) in FunctionList if func2 has space after colon

Expected Behavior

Should show def func3(a,b) in FunctionList if func2 has space after colon

Debug Information

Notepad++ v8.8.1   (64-bit)
Build time : May  3 2025 - 18:41:09
Scintilla/Lexilla included : 5.5.6/5.4.4
Boost Regex included : 1_85
Path : C:\usr\local\apps\npp\npp.8.8.1.portable.x64\notepad++.exe
Command Line : PowerEditor\installer\functionList\python.xml
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.4061
Current ANSI codepage : 1252
Plugins : 
    CollectionInterface (1)
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)

Anything else?

add \h* before the $ in the lookaheads. (I will be submitting PR momentarily)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions