Spyder: Tabs as indentation - characters being removed in editor

Created on 24 Jan 2017  路  9Comments  路  Source: spyder-ide/spyder

Description

In the main editor, tabbing forward then backward deletes some characters on the same line

What steps will reproduce the problem?

  1. Preferences -> Editor -> Advanced Settings -> 'Indentation Character' = Tabs
  2. create empty python file in spyder
  3. add line # comment
  4. put cursor on added line, tab forward then backward
  5. '# c' gets deleted

What is the expected output? What do you see instead?

tab should be added and removed without deleting other characters

Please provide any additional information below

  • more characters are removed if line indented further
  • if I use backspace I get the same behaviour, however if I use the 'delete' key this works fine.
  • attached picture shows indentation settings
    screenshot from 2017-01-24 18-19-42

Version and main components

  • Spyder Version: 3.1.0
  • Python Version: 2.7.13
  • Qt Versions: 5.6.2, PyQt5 5.6 on Linux

Dependencies

pyflakes >=0.5.0 :  1.5.0 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
numpy >=1.7      :  1.11.3 (OK)
sphinx >=0.6.6   :  1.5.1 (OK)
rope >=0.9.4     :  0.9.4 (OK)
jedi >=0.8.1     :  0.9.0 (OK)
psutil >=0.3     :  5.0.1 (OK)
matplotlib >=1.0 :  1.5.3 (OK)
sympy >=0.7.3    :  1.0 (OK)
pylint >=0.25    :  1.6.4 (OK)

Editor Completed 3-Moderate Bug

All 9 comments

@rlaverde, please take a look at this one.

It seems like I have an issue that is somewhat along the lines of the one described in this topic. I just thought I'd mention it as I noticed there was an update scheduled for 3.1.4 but I'm running 3.1.2 - will that update fix my problem as well? Here's how I reproduce this problem:

type the following:

12345
12345

then place cursor in front of 1 on the first line and hit tab. Then down arrow (which should place the cursor at position 1 of line 2), tab, down arrow tab, etc until all numbers are tabbed over. Now place cursor on line 1 at the 1st position and hit tab, down arrow, tab, and you'll end up with this:

        12345
        45

If I start with this:

1
2
3

and then do the same tab down thing like above, when you get to line 2 it deletes the entire line, probably because the four spaces are overwriting the carriage return.

What might also be related to this is if you type the following:

1
2

and do the same tab thing as above (tab, down, tab), then back up and tab, down, tab. You end up with this:

    1
        2

so the indentation is kinda screwy, and that might be what's causing stuff to get overwritten.

I was finally able to update spyder (I'm relatively new at github and spyder/anaconda) and it looks like the issues I mentioned above are resolved. Sorry about the extra post on a completed issue and I appreciate your help to fix this issue.

Hi
I have the same problem in Spyder 3.1.4 with Python 2.7.13 (32 bits and 64 bits).

I think this will be fixed in Spyder 3.2. So please wait until that version is available (hopefully in a couple of days) and try again.

Still having this problem with Spyder 3.3.3

TAB is overwriting text in the version of Spyder that I just downloaded. Very frustrating. Exactly as msoultan described in 2017.

same problem with spyder 4.0.1

@asyates, please open a new issue about this so we can take a look at it again. Thanks!

Was this page helpful?
0 / 5 - 0 ratings