smart indent?

264 views
Skip to first unread message

gunxu

unread,
Jan 12, 2007, 4:01:04 PM1/12/07
to PyScripter
Is there a easy way to add smart indent features into the text editor?
Is there any patches make the editor to de-indent when i type elif,
break, and return?

I may also work for me if i can highlight a code region and have the
"smart indenter" to autoformatting my code according to the code
context.

Kiriakos Vlahos

unread,
Jan 13, 2007, 4:34:48 AM1/13/07
to PyScr...@googlegroups.com
PyScripter automatically deindents when the statement contains return, break or elif.  Which version of PyScripter are you using?  What are the editor options (Tools, Options, Editor Options...) under the Options Tab?

gunxu

unread,
Jan 20, 2007, 8:52:20 AM1/20/07
to PyScripter
Thanks for quick response. The problem still exists. I use the lastest
1.7.2.6 and the editor options are all from default

the checked boxes are

auto indent
drag and drop editing
Maintain caret column
tab indent
smart tab deletete
tabs to spaces
enhance home key
show scrolbar as necessary
trim tailing spaces
group undo
theme selection

One more bad news. When i use pylint with pyscript default launch
setting, I found the error

--parseable invalid option

I have to delete this option to make pylint works. I used the latest
version of pylint 0.12.2, common 0.21.1, and astng 0.16.3 and my python
version is 2.5

> ------=_Part_52611_16010939.1168680888977
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 870
>
> <div>PyScripter automatically deindents when the statement contains return, break or elif.&nbsp; Which version of PyScripter are you using?&nbsp; What are the editor options (Tools, Options, Editor Options...) under the Options Tab?
> </div><br><br>
> <div><span class="gmail_quote">On 12/01/07, <b class="gmail_sendername">gunxu</b> &lt;<a href="mailto:Xu....@gmail.com">Xu....@gmail.com</a>&gt; wrote:</span>
> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Is there a easy way to add smart indent features into the text editor?<br>Is there any patches make the editor to de-indent when i type elif,
> <br>break, and return?<br><br>I may also work for me if i can highlight a code region and have the<br>&quot;smart indenter&quot; to autoformatting my code according to the code<br>context.<br><br><br>
> ------=_Part_52611_16010939.1168680888977--

PyScripter

unread,
Jan 24, 2007, 12:20:15 PM1/24/07
to PyScripter
I cannot reproduce this problem. Smart indenting works well here.

For example when I type

def f():

and press enter it automaticall intents.

then when I type

return 1

it automatically dedents. Works also well with break etc. So I am
quite puzzled, especially since nobody else has reported such problem
and this feature has been available since the first version of
PyScripter.

Regarding auto-indentation you can define the following tool that uses
the Python scirpt reindent.py included in the Python distribution. It
will replace the contents of the current file with the output of
reindent. It works using standard input and output so no files are
saved in the process. If an error occurs just undo to go back to what
you had before running the tool.


[Tools\Tool9\ExternalTool]
Caption=ReIndent
Description=Reindent the current file
ApplicationName=$[PythonExe-Short]
Parameters=$[PythonDir-Short]Tools\Scripts\reindent.py
ShortCut=0
Context=tcActiveFile
ProcessInput=piActiveFile
ProcessOutput=poActiveFile
MessagesFormat=$[FileName] $[LineNumber]

Make sure the "Capture Output" and "Wait for Termination options are
also set.

Hope this helps

gunxu

unread,
Feb 2, 2007, 11:57:38 PM2/2/07
to PyScripter
thanks, mysteriously the problem gone. Maybe it just me don't have
enough coffee those days.

Thanks for reponse.


BTW, any answer to my pylint problem

Reply all
Reply to author
Forward
0 new messages