<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Terry,<div class=""><br class=""></div><div class="">Thanks for your message. <br class=""><div><blockquote type="cite" class=""><div class="">On Nov 2, 2017, at 5:24 PM, Terry Reedy <<a href="mailto:tjreedy@udel.edu" class="">tjreedy@udel.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 11/2/2017 7:20 PM, Irv Kalb wrote:<br class=""><br class=""><blockquote type="cite" class="">I use IDLE when teaching classes, and I use it to develop small programs for my lessons. I have found a bug that has been in IDLE for a while, and I finally got frustrated enough with it to write.<br class="">I am running on a Mac using IDLE version 3.6.1:<br class="">Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)<br class="">[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin<br class=""></blockquote><br class="">From the date, this appears to be the binary from <a href="http://python.org" class="">python.org</a>.<br class=""></div></div></blockquote><div><br class=""></div><div>Yes, I am using an absolutely standard download from <a href="http://python.org" class="">python.org</a>. No modifications at all.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="">Did you upgrade tcl/tk as specified at<br class=""><a href="https://www.python.org/download/mac/tcltk/" class="">https://www.python.org/download/mac/tcltk/</a> ?<br class=""></div></div></blockquote><div><br class=""></div><div>No, I have not. I had no idea that I needed to do this. I just took a look at that page, and it does suggest that I need to upgrade. </div><br class=""><blockquote type="cite" class=""><div class=""><div class="">What Tk version is shown by Help => About IDLE?<br class=""></div></div></blockquote><div><br class=""></div><div>It says Tk version: 8.5.15</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">running Max OS X 10.12.6 - but I also see this same problem when I am in class running Windows 10, with Python 3.6.???<br class=""></blockquote>I use Windows 10 and I cannot reproduce the problem you report with any of 2.7.14, 3.6.3, or 3.7.0a2. I used<br class="">if a:<br class=""> if b:<br class=""> if c:<br class=""> d<br class=""> d<br class=""> f<br class="">for testing. Please post a sample text that fails on Windows 10. If you want, do what I would do and insert it into the following code.<br class=""></div></div></blockquote><div><br class=""></div><div>Unfortunately, I won't be able to do that until next week when I am back at the school. I will try to remember to do that then.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">import tkinter as tk<br class="">root = tk.Tk()<br class="">text = tk.Text(root)<br class="">sample = '''<br class=""><replace this with sample that allows reported error><br class="">'''<br class="">text.insert('1.0', sample)<br class="">text.pack()<br class="">root.mainloop()<br class=""><br class="">Then run and click in the resulting Text window and see if the behavior is the same or different. Mouse clicks in the text area of an editor window are primarily handled by tk, not IDLE or even tkinter. Without running this control experiment, there is no reason to blame IDLE.<br class=""></div></div></blockquote><div><br class=""></div><div>I just tried your test on my Mac with the following:</div><div><br class=""></div><div><div>import tkinter as tk</div><div>root = tk.Tk()</div><div>text = tk.Text(root)</div><div>sample = '''</div><div>if x:</div><div> y = 1</div><div>'''</div><div>text.insert('1.0', sample)</div><div>text.pack()</div><div>root.mainloop()</div><div><br class=""></div><div>I run it, it brings up a widow with the two lines, and the same problem occurs there.</div></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">> One thing to point out, I always use the Tab key to indent my lines. However, even if I type many space characters to indent, I see the same (incorrect behavior).<br class=""><br class="">Unless you have a particular undocumented entry in <HOME>/.idlerc/config-main.cfg, tabs are converted to spaces (default 4) before insertion into the text widget. If the <- and -> arrow keys always move one character, you have spaces.<br class=""></div></div></blockquote><div><br class=""></div><div>I have not changed any configuration like this.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">If I have an indented line, and I click just to the left of the first real character on that line, often IDLE will place the insertion cursor at the wrong place - at one character to the right of the left edge of the window. If I click in the same spot (Just to the left of the first real character on the line), IDLE responds by moving the insertion cursor one space to the right. Depending on how many times the line I'm clicking on has been indented, IDLE eventually highlights a section from the last character of the previous line to just before the first real character of the line where I clicked. If I click one more time, IDLE puts the insertion character in the correct place.<br class=""></blockquote><br class="">For me, a sinple click places the the cursor on the nearest between-character slice line, either to the left or right of where I click. Two clicks that are rapid enough to be interpreted as a double click select a word or non-word slice. Similarly, clicks with the bar overlapping two lines are pushed to the 'closer' line, either up or down.<br class=""><br class="">--<br class="">Terry Jan Reedy<br class="">_______________________________________________<br class="">IDLE-dev mailing list<br class=""><a href="mailto:IDLE-dev@python.org" class="">IDLE-dev@python.org</a><br class="">https://mail.python.org/mailman/listinfo/idle-dev<br class=""><br class=""></div></div></blockquote><br class=""></div><div>Sounds like I need to upgrade TCL. Following the links on the page you provided, it looks like I need to download ActiveTCL, with the newest version being 8.6.6 from <a href="http://ActiveState.com" class="">ActiveState.com</a>.</div><div><br class=""></div><div>Does that sound right?</div><div><br class=""></div><div>How would the average person (who doesn't follow links on forums like this and get expert help from someone like you) know to do this???</div><div><br class=""></div><div>Thanks,</div><div><br class=""></div><div>Irv</div><div><br class=""></div><div><br class=""></div><br class=""></div></body></html>