jamalsenouci / sublimetext-syntaxfold

Sublime Text Plugin that provides a configurable command and popup for folding code based on syntax
MIT License
40 stars 6 forks source link

TypeError: String required #46

Open akohlsmith opened 4 months ago

akohlsmith commented 4 months ago

master from today (commit:5dbc247), Sublime Text 3 build 4169, OSX 14.4.1.

the default settings have been pared down to an empty file, and the user settings only have one entry now:

{
    "config":[
        {
            "scope": "source.c++, source.c",
            "startMarker": [ "#pragma region", "#ifdef", "#ifndef", "#if" ],
            "endMarker": [ "#pragma endregion", "#endif", "#else", "#elif" ],
        },
    ]
}

The test C file I have created:

#if foo
void some_func(void)
{
    do_the_thing();
}
#endif

If I check the scope I see source.c meta.preprocessor.c which should match the scope in the user settings above.

Doesn't matter where I have the cursor (start, middle or end of #if foo, somewhere in the block, start or end of #endif), nothing happens. If I open the console, I see this:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1499, in run_
    return self.run(edit)
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Packages/SyntaxFold/SyntaxFold.py", line 187, in run
    fold_regions = get_all_fold_regions(self.view)
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Packages/SyntaxFold/SyntaxFold.py", line 98, in get_all_fold_regions
    start_positions, end_positions = get_all_positions(view,marker_pair)
  File "/Users/andrew/Library/Application Support/Sublime Text 3/Packages/SyntaxFold/SyntaxFold.py", line 67, in get_all_positions
    start_markers = view.find_all(start_marker)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime.py", line 1416, in find_all
    return sublime_api.view_find_all(self.view_id, pattern, flags)
TypeError: String required

I was getting an error about the .cs syntax folding which is why I cleared out the default settings file and focused on the user settings one.