[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

Ned Deily report at bugs.python.org
Sat Aug 16 10:33:02 CEST 2014


Ned Deily added the comment:

Thanks for addressing the comments.  With linenumber-text-widget-v2.diff:

1. With Tk 8.4, the extension gets a bit further but still fails:

  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/__main__.py", line 9, in <module>
    idlelib.PyShell.main()
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/PyShell.py", line 1570, in main
    shell = flist.open_shell()
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/PyShell.py", line 327, in open_shell
    if not self.pyshell.begin():
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/PyShell.py", line 1054, in begin
    (sys.version, sys.platform, self.COPYRIGHT, nosub))
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/PyShell.py", line 1296, in write
    count = OutputWindow.write(self, s, tags, "iomark")
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/OutputWindow.py", line 40, in write
    self.text.insert(mark, s, tags)
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/Percolator.py", line 25, in insert
    self.top.insert(index, chars, tags)
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/LineNumber.py", line 81, in insert
    self.changed_callback(get_end(self.delegate))
  File "/Users/nad/Projects/PyDev/active/dev/3x/t/idlelib/LineNumber.py", line 158, in update_sidebar_text
    self.sidebar_text['width'] += width_difference
TypeError: Can't convert 'int' object to str implicitly

2. I just noticed that the (now) "Line Number" menu item has no visual indication of its state nor does it preserve its state over IDLE sessions.  The Code Context extension for edit windows does both: the menu item has a checkmark when enabled and that state is restored when IDLE is restarted.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17535>
_______________________________________


More information about the Python-bugs-list mailing list