Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: Add lineno sidebar to editor window #74848

Closed
mlouielu mannequin opened this issue Jun 14, 2017 · 4 comments
Closed

IDLE: Add lineno sidebar to editor window #74848

mlouielu mannequin opened this issue Jun 14, 2017 · 4 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@mlouielu
Copy link
Mannequin

mlouielu mannequin commented Jun 14, 2017

BPO 30663
Nosy @terryjreedy, @taleinat, @mlouielu, @csabella
PRs
  • bpo-30663: IDLE: Add lineno sidebar to editor window #2183
  • Superseder
  • bpo-17535: IDLE editor line numbers
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2019-07-08.09:04:15.670>
    created_at = <Date 2017-06-14.09:14:41.299>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Add lineno sidebar to editor window'
    updated_at = <Date 2019-07-10.02:59:49.031>
    user = 'https://github.com/mlouielu'

    bugs.python.org fields:

    activity = <Date 2019-07-10.02:59:49.031>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2019-07-08.09:04:15.670>
    closer = 'cheryl.sabella'
    components = ['IDLE']
    creation = <Date 2017-06-14.09:14:41.299>
    creator = 'louielu'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30663
    keywords = []
    message_count = 4.0
    messages = ['295995', '347502', '347523', '347594']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'taleinat', 'louielu', 'cheryl.sabella']
    pr_nums = ['2183']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '17535'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30663'
    versions = ['Python 3.7']

    @mlouielu
    Copy link
    Mannequin Author

    mlouielu mannequin commented Jun 14, 2017

    In bpo-7676, the desired pattern request from Terry is to create a sidebar and show the prompt in the sidebar.

    To complete the request, this patch add the lineno sidebar in editor window , to prove that the sidebar in IDLE is feasible.

    The different in pyshell, it that the sidebar will need to deal with indent (to not show the prompt).

    @mlouielu mlouielu mannequin added the 3.7 (EOL) end of life label Jun 14, 2017
    @mlouielu mlouielu mannequin assigned terryjreedy Jun 14, 2017
    @mlouielu mlouielu mannequin added topic-IDLE type-feature A feature request or enhancement labels Jun 14, 2017
    @csabella csabella closed this as completed Jul 8, 2019
    @terryjreedy
    Copy link
    Member

    A closing note: Saimadhav Heblikar's initial patch on bpo-17535 was a standalone proof-of-concept file was based on Canvas and Text subclasses. The latter consisted mostly of two tk.eval(tcl_code) calls. I rejected the idea of using tk.eval, as review and maintenance would requires knowing tcl. But the submission won him my GSOC mentorship (and we did quite well working together, even though line-numbering was not finished).

    Saimadhav's poc appears to have been inspired by Bryan Oakley's Canvas and Text-based answer a year earlier on https://stackoverflow.com/a/16375233. But Bryan only used tk.call and tk.createcommand, not tk.eval. Some of Saimadhav's tcl appears to be a translation of some of Bryan's python.

    PR 2183 is a full patch also based on Canvas and Text and explicitly inspired by Oakley's answer. However, the Text subclass is an edited version of Saimadhav's tk.eval version, not Oakley's. This is properly closed as a duplicate, but it does provide the Oakley link, which does not appear on bpo-17535.

    @taleinat
    Copy link
    Contributor

    taleinat commented Jul 9, 2019

    Thanks for helping to move this forward, Louie!

    My worry with this approach is that all of the line numbers are redrawn upon scrolling, which would be likely to make scrolling less smooth, especially on low-end hardware (where IDLE is relatively often used).

    The alternate implementation approach we are pursuing in bpo-17535 uses a second text widget, whose scrolling is synced to the main text widget, and whose contents are only updated when the number of lines in the main text widget changes.

    @terryjreedy
    Copy link
    Member

    Oakley's patch was intentionally very general, allowing line number heights to vary because of different fonts, font sizes, or widget inclusions. This required positioning line numbers by pixel (hence canvas) and accommodating line size changes even in the absence of newline changes. IDLE's need is simpler (fortunately)l.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants