Open ethanbb opened 2 years ago
Hi @ethanbb thank you for the feedback. I was unable to reproduce the issue with the described steps. Could you post here a video or GIF to better understand how is this happening to you?
Any new info in order to reproduce this in our side is greatly appreciated. Let us know!
Hi @dalthviz, sure, here's a screen recording. This happened in exactly the same way on two different machines on Spyder 5.2.0 in a similar, but not identical, conda environment. Let me know if there's any more info I can provide.
https://user-images.githubusercontent.com/8973825/145664189-aab21158-8d9c-4cb7-a99e-89820acfb569.mp4
Hi again @ethanbb , just in case., could you update to Spyder 5.2.1 and check again? Let us know!
Hi @dalthviz, unfortunately I can confirm that it's still broken in 5.2.1.
Also to add, obviously the minimal example I gave was a bit contrived, but it can come up in real-world files where tabs and spaces are mixed. I came across the bug when I was trying to indent a whole block of code that included a pair of lines where the first had only tabs and the second had spaces followed by a statement.
Is there any way I can get more debugging info? This is such a mysterious bug, I'm curious what's going on. I tried looking at the internal console, but nothing came up.
To get more info you can try to get a debug log by running Spyder with some flags:
spyder --debug-info verbose --debug-output file
That will generate a spyder-debug.log
file in the working directory of the cmd that you used to launch Spyder. After getting it you can check it and post it here (maybe it will enable us to see some traceback or some repetitive operation being done).
Also, maybe running in safe-mode (using a clean config in a temporary directory) could help discard issues with the preferences:
spyder --safe-mode
For more info related to the CLI options that Spyder has you can run spyder --help
Let us know @ethanbb !
OK, here it is - I don't see anything unusual, but maybe you can take a look.
After some trying I was able to reproduce this @ethanbb ! In the preferences for the Editor under the Source
tab, what is the preference for the Indentation characters
you have set? My first guess is that this has something to do with setting that preference with the Tabulation
value. Could you try setting it to 4 spaces instead an see if that helps?
Not totally sure why this could be happening but we will try to fix it in a future release :+1:
Let us know!
@dalthviz Glad to hear you could replicate it. For me it happens when the preference is set to either Tabulation or 4 spaces.
Another, probably unrelated quirk I noticed is that when using Shift+Tab to de-dent regions with indentation set to 4 spaces, only 3 spaces were removed from each line if and only if the highlighted region was only whitespace. (As I'm writing this I realize this bug is unlikely to ever inconvenience anyone...still, something's funky!)
Thank you for the new info @ethanbb ! Indeed quite strange behavior there. We need for sure to give it a check to the functionality to handle tabs vs spaces and indentation behavior (most probably the current logic is not properly handling specific cases)
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
A hang/crash occurs in certain situations involving mixed tabs and spaces. A prototypical example is shown below; Spyder will crash if one highlights both lines and presses the Tab key.
More details:
What steps reproduce the problem?
Reproducing is a little tricky since it appears that the latest version of Spyder has another bug where changing the indentation preference doesn't take effect until restart.
What is the expected output? What do you see instead?
Expected: both lines are indented according to the current indentation mode. Actual: Spyder hangs.
Versions
Dependencies