Home Download Buy Blog Forum Support

Bug report: Code folding from plugin

Bug report: Code folding from plugin

Postby quarnster on Tue May 15, 2012 6:47 am

Select the menu item Tools->New Plugin, paste the following code
Code: Select all
import sublime

view = sublime.active_window().active_view()
endline, endcol = view.rowcol(view.size())
line = 0
regions = []
while line < endline:
    region = view.full_line(view.text_point(line, 0))
    data = view.substr(region)
    if data.startswith("Hello"):
        regions.append(region)
    line += 1
view.fold(regions)


"""
Hello
World!
Hello
World!
Hello
World!
Hello
World!
"""


And save. All the "Hello" lines will be folded up leaving us with only the "World!" lines, which is the correct behavior.

Now try to unfold these by moving the mouse cursor to the left and click on one of the triangles. The text is not unfolding, and also in my opinion the triangles are off by one line (the first triangle should be shown at the first World! and not the """).
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Bug report: Code folding from plugin

Postby bizoo on Tue Jun 05, 2012 10:15 am

I can confirm this bug on my own plugin.

startup, version: 2198 windows x64 channel: nightly
bizoo
 
Posts: 880
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 20 guests