summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/editor.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)Miss Islington (bot)2020-05-291-4/+11
| | | | | | Leave selection when right click within. This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d. I did not realize that this completely disabled the context menu entries, and I should have merged a minimal fix immediately. An automated test should follow. (cherry picked from commit 97e4e0f53d6690db6b942678489716a30925b8af) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)Miss Islington (bot)2020-03-091-12/+10
| | | | | | | Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog. The new box checks for positivity before returning. (cherry picked from commit 363fab83b8a0e6d924c7a7c577feec6a2812bb8c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-39885: IDLE context menu clears selection (GH-18859)Miss Islington (bot)2020-03-081-0/+1
| | | | | | | Since clicking to get an IDLE context menu moves the cursor, any text selection should be and now is cleared. (cherry picked from commit 4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)Miss Islington (bot)2020-03-081-1/+4
| | | | | | | | It appears standard that moving the text insert cursor away from a selection clears the selection. Clearing prevents accidental deletion of a possibly off-screen bit of text. The update is for Ln and Col on the status bar. (cherry picked from commit 2522db11df102be3baf25ce9e816ebe8ffdb7fcc) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-38792: Remove IDLE shell calltip before new prompt. (GH-17150)Miss Islington (bot)2020-01-311-1/+1
| | | | | | | | | Previously, a calltip might be left after SyntaxError, KeyboardInterrupt, or Shell Restart. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Tal Einat <taleinat+github@gmail.com> (cherry picked from commit bfdeaa37b3df7466624c17f9450d2bd1c3d95edf) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)Miss Islington (bot)2020-01-211-21/+34
| | | | | | | | | | Fix comments and add tests for editor newline_and_indent_event method. Remove unused None default for function parameter of pyparse find_good_parse_start method and code triggered by that default. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit ec64640a2c5236d7a5d5470d759172a3d93eab0b) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)Miss Islington (bot)2019-11-201-2/+3
| | | | | | | These Format menu functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in 3.7.5 and 3.8.0. (cherry picked from commit b8462477bfd01ff21461065d5063e6b0238ca809) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-4630: Add cursor no-blink option for IDLE (GH-16960)Miss Islington (bot)2019-11-131-0/+16
| | | | | | This immediately toggles shell, editor, and output windows, but does not affect other input widgets. (cherry picked from commit 9c2844927d15b2d3e21b28d62249dead02b5b597) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-13153: Use OS native encoding for converting between Python and Tcl. ↵Miss Islington (bot)2019-10-041-26/+3
| | | | | | | | | | | | | | | (GH-16545) On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the "surrogatepass" error handler for converting to/from Tcl Unicode objects. On Linux use UTF-8 with the "surrogateescape" error handler for converting to/from Tcl String objects. Converting strings from Tcl to Python and back now never fails (except MemoryError). (cherry picked from commit 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)Miss Islington (bot)2019-09-171-4/+7
| | | | | | | | One happens when EditorWindow.close is called twice. Printing a traceback, when IDLE is run from a terminal, is useless and annoying. (cherry picked from commit dfd34a9cd58e8150c324190f746de919e140abe8) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-38183: Test_idle ignores user config directory GH-16198)Miss Islington (bot)2019-09-171-16/+18
| | | | | | | It no longer tries to create or access .idlerc or any files within. Users must run IDLE to discover problems with saving settings. (cherry picked from commit 0048afc16a7e7301d5c565237db271505e5fbed9) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-37902: IDLE: Add scrolling for IDLE browsers. (GH-15368)Miss Islington (bot)2019-09-051-20/+5
| | | | | | | Modify the wheel event handler so it can also be used for module, path, and stack browsers. Patch by George Zhang. (cherry picked from commit 2cd902585815582eb059e3b40e014ebe4e7fdee7) Co-authored-by: GeeTransit <geetransit@gmail.com>
* bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)Miss Islington (bot)2019-08-251-3/+22
| | | | | | | | | | | | These were caused by keeping around a reference to the Squeezer instance and calling it's load_font() upon config changes, which sometimes happened even if the shell window no longer existed. This change completely removes that mechanism, instead having the editor window properly update its width attribute, which can then be used by Squeezer. (cherry picked from commit d4b4c00b57d24f6ee2cf3a96213406bb09953df3) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
* bpo-29446: IDLE -- add explicit imports (GH-14919) (#14921)Miss Islington (bot)2019-07-231-0/+2
| | | | | | Stop depending on tkinter import *. (cherry picked from commit c6fd6c83b70df76421d05a7628367e64a2f83589) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.7] bpo-17535: IDLE editor line numbers (GH-14030)Tal Einat2019-07-231-13/+49
| | | (cherry picked from commit 7123ea009b0b004062d91f69859bddf422c34ab4)
* bpo-36390: Gather IDLE Format menu functions into format.py (GH-14827) ↵Miss Islington (bot)2019-07-181-30/+4
| | | | | | | | | | (GH-14830) Add two indent spec methods from editor and Rstrip to existing file. Tests are not added for indent methods because they need change in lights of 3.x's prohibition on mixing tabs and spaces. (cherry picked from commit 1b3892243433da7eae7f5f3a4f98f13d309c8926) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-36390: IDLE: Combine region formatting methods. (GH-12481) (GH-14812)Miss Islington (bot)2019-07-171-111/+10
| | | | | | | Rename paragraph.py to format.py and add region formatting methods from editor.py. Add tests for the latter. (cherry picked from commit 82494aa6d947c4a320c09c58fe0f100cdcf7af0b) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-37530: simplify, optimize and clean up IDLE code context (GH-14675)Miss Islington (bot)2019-07-171-3/+16
| | | | | | | | | | | | | | * Only create CodeContext instances for "real" editors windows, but not e.g. shell or output windows. * Remove configuration update Tk event fired every second, by having the editor window ask its code context widget to update when necessary, i.e. upon font or highlighting updates. * When code context isn't being shown, avoid having a Tk event fired every 100ms to check whether the code context needs to be updated. * Use the editor window's getlineno() method where applicable. * Update font of the code context widget before the main text widget (cherry picked from commit 7036e1de3a87d36c7ef41b8a2b44ed6fc4d34be2) Co-authored-by: Tal Einat <taleinat@gmail.com>
* bpo-36390: simplify classifyws(), rename it and add unit tests (GH-14500)Miss Islington (bot)2019-07-111-23/+16
| | | | | (cherry picked from commit 9b5ce62cac27fec9dea473865d79c2c654312957) Co-authored-by: Tal Einat <taleinat@gmail.com>
* bpo-5680: IDLE: Customize running a module (GH-13763)Miss Islington (bot)2019-06-181-0/+1
| | | | | | The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu. (cherry picked from commit 201bc2d18b60adb05810d2a6ab396047bc527088) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* IDLE: Fix typos in docs and comments (GH-13749)Miss Islington (bot)2019-06-031-1/+1
| | | | | (cherry picked from commit d9677f36fe486e86bb86f2cd59cb7fc3804bdac1) Co-authored-by: Xtreak <tir.karthi@gmail.com>
* bpo-35610: IDLE - Replace .context_use_ps1 with .prompt_last_line (GH-11307)Miss Islington (bot)2019-06-021-6/+1
| | | | | | Changes in bpo- 31858 made the less informative 'context_use_ps1' redundant. (cherry picked from commit 6bdc4dee01788599808c7858e2fe9fdd72cf6792) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-36152: IDLE: Remove unused parameter from colorizer (GH-12109)Miss Islington (bot)2019-03-011-1/+1
| | | | | | Remove colorizer.ColorDelegator.close_when_done and the corresponding argument of .close(). In IDLE, both have always been None or False since 2007. (cherry picked from commit b9f0354efce95b7557bc43ea193c4b652cd28392) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-35769: Change IDLE's name for new files from 'Untitled' to 'untitled' ↵Miss Islington (bot)2019-01-181-2/+2
| | | | | | | | (GH-11602) 'Untitled' violates the PEP 8 standard for .py files (cherry picked from commit a902239f22c322d8988c514dd1c724aade3e4ef3) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-35196: Optimize Squeezer's write() interception (GH-10454)Miss Islington (bot)2019-01-131-3/+0
| | | | | | | The new functionality of Squeezer.reload() is also tested, along with some general re-working of the tests in test_squeezer.py. (cherry picked from commit 39a33e99270848d34628cdbb1fdb727f9ede502a) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
* IDLE: Create function to update menu item state. (GH-11343)Miss Islington (bot)2018-12-281-1/+6
| | | | | | This will be needed for other menu items. Change outwin to call the function instead of updating the menu item directly. (cherry picked from commit 804a5d94b6b7f8cb8546112aee2bc3af362f28f5) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-22703: IDLE: Improve Code Context and Zoom Height menu labels (GH-11214)Miss Islington (bot)2018-12-221-0/+5
| | | | | | | | | | The Code Context menu label now toggles between Show/Hide Code Context. The Zoom Height menu now toggles between Zoom/Restore Height. Zoom Height has moved from the Window menu to the Options menu. https://bugs.python.org/issue22703 (cherry picked from commit c1b4b0f6160e1919394586f44b12538505fed300) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)Miss Islington (bot)2018-09-251-3/+4
| | | | | (cherry picked from commit 604e7b9931f9e7881a2941816e538f5f15930db8) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
* bpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678)Miss Islington (bot)2018-08-101-6/+17
| | | | | (cherry picked from commit 077059e0f086cf8c8b7fb9d1f053e38ddc743f59) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
* bpo-33924: Change IDLE mainmenu.menudefs key 'windows' to 'window' (GH-7836)Miss Islington (bot)2018-06-211-3/+3
| | | | | | | Every other menudef key is the lowercase version of the corresponding main menu entry (in this case, 'Window'). (cherry picked from commit 33c7420e7dd9d8e5b2aa15e98da6291bab6fcf33) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-33906: Rename idlelib.windows as window (GH-7833)Miss Islington (bot)2018-06-211-7/+7
| | | | | | | Match Window on the main menu and remove last plural module name. Change imports, test, and attribute references to match new name. (cherry picked from commit a361e89d5ae3daefe9e8b8a7e889cd2ad8c45b77) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-33904: In IDLE's rstrip, rename class RstripExtension as Rstrip (GH-7811)Miss Islington (bot)2018-06-201-2/+2
| | | | | (cherry picked from commit 9bb92235f6272b28d59fcbd04f101fdc6b1bbc50) Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <srinivasreddy@users.noreply.github.com>
* bpo-33907: Rename an IDLE module and class. (GH-7807)Miss Islington (bot)2018-06-201-6/+6
| | | | | | | Improve consistency and appearance. Module idlelib.calltips is now calltip. Class idlelib.calltip_w.CallTip is now Calltip. (cherry picked from commit 06e2029dfa500a42e3565ed7ba8573412f153d1c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-33855: Minimally test all IDLE modules. (GH-7689)Miss Islington (bot)2018-06-151-2/+2
| | | | | | Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files. (cherry picked from commit ee5ef309c7e2daef1248730145408f700732c42e) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-33664: Scroll IDLE editor text by lines (GH-7351)Miss Islington (bot)2018-06-041-2/+27
| | | | | | | | | Previously, the mouse wheel and scrollbar slider moved text by a fixed number of pixels, resulting in partial lines at the top of the editor box. The change also applies to the shell and grep output windows, but not to read-only text views. (cherry picked from commit d49dbd9acc6db544ca6cb2445fe17eb0c3be4bba) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-21474: Update IDLE word/identifier definition from ascii to unicode. ↵Miss Islington (bot)2018-04-301-4/+4
| | | | | | | | | | (GH-6643) In text and entry boxes, this affects selection by double-click, movement left/right by control-left/right, and deletion left/right by control-BACKSPACE/DEL. (cherry picked from commit 5ff3a161c8a6b525c5e5b3e36e9c43f5a95bda60) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-32916: IDLE: Change `str` to `code` in pyparse (GH-5830)Miss Islington (bot)2018-02-241-2/+2
| | | | | | Adjust tests and user modules to match. (cherry picked from commit c29c03a34a9f3c82704b66f323ce5ea9dc89c8af) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484)Cheryl Sabella2017-11-231-1/+1
| | | Patch mostly by Cheryl Sabella
* IDLE -- Restrict shell prompt manipulaton to the shell. (#4143)Terry Jan Reedy2017-10-281-11/+4
| | | | | | Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed.
* bpo-31460: Simplify the API of IDLE's Module Browser. (#3842)Terry Jan Reedy2017-09-301-3/+1
| | | | | | Passing a widget instead of an flist with a root widget opens the option of creating a browser frame that is only part of a window. Passing a full file name instead of pieces assumed to come from a .py file opens the possibility of browsing python files that do not end in .py.
* bpo-31459: Rename IDLE's module browser from Class Browser to Module ↵Cheryl Sabella2017-09-231-5/+5
| | | | | | | | | | | Browser. (#3704) The original module-level class and method browser became a module browser, with the addition of module-level functions, years ago. Nested classes and functions were added yesterday. For back- compatibility, the virtual event <<open-class-browser>>, which appears on the Keys tab of the Settings dialog, is not changed. Patch by Cheryl Sabella.
* bpo-27099: IDLE - Convert built-in extensions to regular features (#2494)wohlganger2017-09-101-12/+52
| | | | | | | | | | | | | | | | | | | | | About 10 IDLE features were implemented as supposedly optional extensions. Their different behavior could be confusing or worse for users and not good for maintenance. Hence the conversion. The main difference for users is that user configurable key bindings for builtin features are now handled uniformly. Now, editing a binding in a keyset only affects its value in the keyset. All bindings are defined together in the system-specific default keysets in config- extensions.def. All custom keysets are saved as a whole in config- extension.cfg. All take effect as soon as one clicks Apply or Ok. The affected events are '<<force-open-completions>>', '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not affect their keyset- specific customization after 3.6.3. and vice versa. Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.
* bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (#2629)terryjreedy2017-07-081-2/+2
|
* bpo-29910: IDLE no longer deletes a character after commenting out a region ↵Serhiy Storchaka2017-06-271-6/+24
| | | | | | | | | | | (#825) This happened because shortcut has a class binding and 'break' was not returned. Fix other potential conflicts between IDLE and default key bindings. * Add news item * Update NEWS
* bpo-24813: IDLE: Add default title to help_about (#2366)csabella2017-06-241-1/+1
| | | Patch by Cheryl Sabella.
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+0
| | | Make also minor PEP8 coding style fixes on modified imports.
* Issue #27891: Consistently group and sort imports within idlelib modules.Terry Jan Reedy2016-08-311-20/+21
|
* Issue 27437: Add query.ModuleName and use it for file => Load Module.Terry Jan Reedy2016-07-031-38/+20
| | | | Users can now edit bad entries instead of starting over.
* Issue 27372: Stop test_idle from changing locale, so test passes.Terry Jan Reedy2016-06-261-2/+6
| | | | In 3.6, the warning is now called an error, making it harder to ignore.
* Issue *24750: Switch all scrollbars in IDLE to ttk versions.Terry Jan Reedy2016-06-101-0/+1
| | | | Where needed, add minimal tests to cover changes.