[wingide-users] Re: wingide-users Digest, Vol 53, Issue 6

Wingware Support support at wingware.com
Wed Sep 10 13:46:16 MDT 2008

Marc A. Murison wrote:
> I, too, run into this behavior.  Here's how you can reproduce it (on my 
> Windoze XP box, anyway):  First, convert a script file to 4-space "Tabs 
> Only".  No need to save to disk.  Then go to any function definition and 
> try to insert a docstring using double quotes.  Upon typing the first 
> three dquotes, the document will all of a sudden convert to 8-space 
> tabs.  Upon typing the closing three dquotes, it converts back to 
> 4-space tabs.  For example,

Thanks, I've reproduced this now and we'll see what we can do to fix it. 
  For those interested in the details -- a second triple quoted string 
is needed later in the file to reproduce it, e.g.

def foo():
     """ blah

def bar():
     """ a
         string with space indents """

While the file is in this state, the next code line after foo()'s doc 
string is '      string with space indents', which begins with 8 spaces. 
  At this point, Wing detects the mixture of tabs & spaces and forces 
tab size to 8 so that it's visually clear that a tab will be interpreted 
as 8 spaces by the Python interpreter.

Wing could possibly not make the switch if some or most of the lines in 
a file aren't parsable, which is usually the case when there's 
mismatched """ strings as there are above.


> #This is fine
> def foo():
>     pass
> #This switches to 8-space tabs
> def foo():
>     """blah blah blah
>     pass
> #Now it goes back to 4-space tabs
> def foo():
>     """blah blah blah"""
>     pass
> Oddly enough, single quotes enclosing the docstrings don't do it for me, 
> and it also doesn't happen if the file is "Spaces Only".  There may be 
> other ways to trigger this behavior -- I'm pretty sure I remember it 
> triggering while commenting out something several days ago, as johnf saw 
> -- but the above in particular is 100 percent repeatable for me.  Hope 
> this helps!
> -- 
> Marc A. Murison
> murison at alpheratz.net <mailto:murison at alpheratz.net>
> http://murison.alpheratz.net/
> Those who would give up essential liberty to purchase a little temporary
> safety deserve neither liberty nor safety.
> Benjamin Franklin, An Historical Review of the Constitution and
> Government of Pennsylvania, 1759
> ------------------------------------------------------------------------
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide

More information about the wingide-users mailing list