This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Christian.Kleineidam, terry.reedy
Date 2014-09-12.21:41:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410558070.79.0.313515775085.issue22354@psf.upfronthosting.co.za>
In-reply-to
Content
I agree that this is an issue, and I believe others have made similar comments or requests, but I cannot find an existing issue for this.

By experiment, it is possible to tag a tab and change the background color for the spaces a tab is visually converted to.  

import tkinter as tk
root = tk.Tk()
text = tk.Text(root)
text.pack()
text.insert('insert', 'a\tb')
text.tag_add('TAB', 1.1, 1.2)
text.tag_config('TAB', background='#ffd')  # light yellow, or
text.tag_config('TAB', background='#eee')  # light gray

http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/text-methods.html
The other tag configuration options that refer to text, such as overstrike and underline, have no visual effect. Neither does non-zero borderwidth.

I am reluctant to add visible characters. The need to delete them would complicate converting tabs to spaces and saving files.  Since Idle normally converts tabs to spaces on input, they are not common in edited files.  The main issue, as you mention, is code imported from elsewhere.

Some issue remain.

1. Tagging tabs: I presume this is no problem, but will not know until there is a patch.

2. The priority of the TAB tag relative to others. The importance of this depends on the next question.

3. Should tab space in comments and strings be shaded?  I think so.  If so, should the shading match the comment/string foreground color?
History
Date User Action Args
2014-09-12 21:41:10terry.reedysetrecipients: + terry.reedy, Christian.Kleineidam
2014-09-12 21:41:10terry.reedysetmessageid: <1410558070.79.0.313515775085.issue22354@psf.upfronthosting.co.za>
2014-09-12 21:41:10terry.reedylinkissue22354 messages
2014-09-12 21:41:09terry.reedycreate