Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor moves to beginning of line automatically disrespecting current indentation #168

Closed
DonJayamanne opened this issue Nov 14, 2017 · 10 comments
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@DonJayamanne
Copy link

From @swarnendubiswas on August 23, 2017 22:31

Environment data

VS Code version: 15.1
Python Extension version: 0.7.0
Python Version: 3.5.4
OS and version: CentOS 7

Actual behavior

Typing enter to go to a new line, causes the cursor to automatically move to the beginning of the line disrespecting the current indentation.

Expected behavior

Cursor should stay at the desired indentation.

Steps to reproduce:

  • Hit enter from an indented code block.

Logs

Output from Python output panel

Output from Console window (Help->Developer Tools menu)

Copied from original issue: DonJayamanne/pythonVSCode#1177

@DonJayamanne
Copy link
Author

Please provide more information with examples

@DonJayamanne
Copy link
Author

From @swarnendubiswas on August 24, 2017 18:9

Please see the following picture: Say the cursor is at the end of line 155. When I press enter, I would expect the cursor to be at the desired column in line 156. The column numbers are not visible, but the desired column in this context is below the first occurrence of character 'm' (from line 155).

What happens is that the cursor stays at the desired column for about a second, and then moves to the beginning of line 156 (i.e., extreme left). This is annoying since one has to manually readjust the indent.

screenshot from 2017-08-24 09-46-52

Does this help?

@DonJayamanne
Copy link
Author

From @gandhis1 on August 24, 2017 18:12

I don't experience this. Can you provide a small source file where the issue occurs?

@DonJayamanne
Copy link
Author

From @swarnendubiswas on August 24, 2017 20:55

@gandhis1 I tried disabling all my Code customizations. For me, it seems adding "editor.formatOnSave": true is triggering the issue. The same happens if I set python.formatting.formatOnSave": true. Could you try it out?

@DonJayamanne
Copy link
Author

@swarnendubiswas unfortunately I too don't experience this issue on my Mac and Windows.
Please confirm you are still experiencing this issue.

@DonJayamanne
Copy link
Author

From @swarnendubiswas on September 13, 2017 19:31

Actually I was testing this only yesterday. Visual Studio Code with extensions disabled works fine, but I still face the issue with the Python extension. Here is my related config:

    "python.formatting.formatOnSave": true,
    "python.formatting.provider": "yapf",
    "python.formatting.yapfArgs": [
        "--style",
        "{based_on_style: google, column_limit:120}"
    ],
    "python.pythonPath": "/workspace/sbiswas/software/Python-3.5.4/build/bin/python3",
    "python.autoComplete.addBrackets": true,
    "python.linting.enabled": true,
    "python.linting.lintOnSave": true,
    "python.linting.flake8Enabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.pep8Enabled": false,
    "python.linting.pydocstyleEnabled": false,
    "python.venvPath": "/workspace/sbiswas/tmp/.virtualenvs",

Could it be related to the formatter? I will test it out disabling the formatters.

@brettcannon brettcannon added awaiting 2-PR bug Issue identified by VS Code Team member as probable bug and removed awaiting 2-PR labels Nov 14, 2017
@DonJayamanne
Copy link
Author

DonJayamanne commented Nov 29, 2017

@gandhis1 I tried disabling all my Code customizations. For me, it seems adding "editor.formatOnSave": true is triggering the issue. The same happens if I set python.formatting.formatOnSave": true. Could you try it out?

@swarnendubiswas It is possible this is the cause of the bug. Please disable python.formatting.formatOnSave.
This setting will be removed in the next release in favor of editor.formatOnSave (vscodes implementation of auto formatting, which was added later on). Details here #285

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed awaiting 1-verification labels Nov 29, 2017
@swarnendubiswas
Copy link

Thanks. I will test and let you know.

@brettcannon
Copy link
Member

I'm closing this as it has been over a month since we requested more info. If we do get the info at a later date we can re-open this issue.

@swarnendubiswas
Copy link

Yes, thanks. I think the issue is resolved.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants