When using ctrl + cmd + down-arrow-key to shift multiple lines of code, entire code block moves once as expected, but is then automatically deselected. Strangely, ctrl + cmd + up-arrow-key works as expected.
What steps will reproduce the problem?
jedi >=0.9.0 : 0.10.2 (OK)
matplotlib >=1.0 : 2.0.2 (OK)
nbconvert >=4.0 : 5.2.1 (OK)
numpy >=1.7 : 1.13.1 (OK)
pandas >=0.13.1 : 0.20.2 (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 5.2.2 (OK)
pyflakes >=0.6.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.6.4 (OK)
qtconsole >=4.2.0: 4.3.0 (OK)
rope >=0.9.4 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.6.2 (OK)
sympy >=0.7.3 : 1.1 (OK)
Thanks for reporting. We'll take a look at this one after we release Spyder 3.2
@ccordoba12
Commenting lines 885 to 892 in base.py solves this issue for me in branch 3.1.x. and 3.x
if len(text) == 0:
#If the next line is blank
sel_text = sel_text[0:-1]
sel_text = os.linesep + sel_text
if not text:
cursor.insertText(sel_text)
cursor.endEditBlock()
return
I've tried to understand why those lines were necessary in the first place and could not find any reason... The rest of the code seems to handle pretty well the empty-line and end-of-file cases without the need for this block of code. So... I'm probably missing something here, but it is a start in the good direction to solve this issue.
@rlaverde maybe you know?
@jnsebgosselin I invited you to the gitter chat room, there we can chat less asynchronously in case you have questions. Thanks for all the work you are doing :-)
You can download an app https://gitter.im/apps, or use the web interface https://gitter.im/spyder-ide/public
maybe you know?
No, I haven't changed that behavior, looking at the history that changes was introduced in #3817 and #2382 for fixing errors with blanks lines and in the end of the file
@rlaverde thanks, this explains a lot. I will look again into this issue taking into consideration the PR you just linked.
@rlaverde Ok, I found what was causing the problem. if len(text) == 0 and if not text all return True when the line below is empty.
While trying to fix this issue, I found other minor behavioural bugs. While trying to fix all these little issues, I ended up rewriting most of the code. Please, see if this is acceptable. Otherwise, I can try to make changes to fix the issue with less modification to better preserve the initial code structure.