mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	In Shell:
1. If a tab is entered at the prompt, allow it to be backspaced away. 2. Eliminate the beep when hitting <enter> at the prompt.
This commit is contained in:
		
							parent
							
								
									cfd4a8b639
								
							
						
					
					
						commit
						1bdca5e051
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -954,6 +954,8 @@ def smart_backspace_event(self, event): | |||
|         want = ((have - 1) // self.indentwidth) * self.indentwidth | ||||
|         ncharsdeleted = 0 | ||||
|         while 1: | ||||
|             if chars == sys.ps1: | ||||
|                 break | ||||
|             chars = chars[:-1] | ||||
|             ncharsdeleted = ncharsdeleted + 1 | ||||
|             have = len(chars.expandtabs(tabwidth)) | ||||
|  | @ -1009,6 +1011,8 @@ def newline_and_indent_event(self, event): | |||
|                 text.mark_set("insert", first) | ||||
|             line = text.get("insert linestart", "insert") | ||||
|             i, n = 0, len(line) | ||||
|             if line == sys.ps1: | ||||
|                 return "break" | ||||
|             while i < n and line[i] in " \t": | ||||
|                 i = i+1 | ||||
|             if i == n: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kurt B. Kaiser
						Kurt B. Kaiser