[Patches] [ python-Patches-1196895 ] in IDLE, assume new text files are python source by default

SourceForge.net noreply at sourceforge.net
Sun Jun 12 06:38:13 CEST 2005


Patches item #1196895, was opened at 2005-05-06 16:25
Message generated for change (Comment added) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1196895&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Jeff Shute (jshute)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: in IDLE, assume new text files are python source by default

Initial Comment:
This changes IDLE so that when you use File->New
Window, it assumes that the file will be python source
by default, so syntax highlighting will be enabled. 
Currently, when you make a new window, it assumes that
it is not python source by default, so you do not get
syntax highlighting until you save the file with
extension .py.

I believe this was the original intent of the code,
based on the test for a missing filename, but it got
broken at some point when the code was modified to
accept a path instead of a missing filename.

----------------------------------------------------------------------

>Comment By: Kurt B. Kaiser (kbk)
Date: 2005-06-11 23:38

Message:
Logged In: YES 
user_id=149084

ColorDelegator 1.15
EditorWindow.py 1.68
Closes Python Bugs 775012 and 800432,
partial fix IDLEfork 763524.

Thanks for the patches!


----------------------------------------------------------------------

Comment By: Jeff Shute (jshute)
Date: 2005-06-10 22:57

Message:
Logged In: YES 
user_id=39615

I noticed that behaviour before, but didn't fix it because I
considered it at the time to be an unrelated bug. (The same
thing happens when you have a file saved as .py, and then
save it as .txt - the coloring is turned off for new text,
but the old text is not uncolored.)  It is also trivial to
fix this problem.  Here is another patch that does so.

----------------------------------------------------------------------

Comment By: Michiel de Hoon (mdehoon)
Date: 2005-06-10 11:02

Message:
Logged In: YES 
user_id=488897

I've tested this patch on Windows.
Without the patch, as soon as the file is saved as
something.py, syntax highlighting is turned on. Before
saving, no syntax highlighting is used.
With the patch, the file is assumed to contain Python code,
and syntax highlighting is turned on immediately.
Unfortunately, if the user is creating a generic text file
(so not containing Python code), syntax highlighting is
turned on even if  the user saves the file as something.txt.
For a correct patch, syntax highlighting should be turned
off again if the user decides to save the file as a *.txt.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2005-05-06 17:21

Message:
Logged In: YES 
user_id=31435

I haven't looked at the patch, but +1 on the idea.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1196895&group_id=5470


More information about the Patches mailing list