Python expand selection doesn't work as expected

Describe the Bug

I’m experiencing issues with python “expand selection” shortcut (Control+Shift+right)

it doesn’t select the current method, but the whole file instead. I created a new Cursor profile to make sure that it’s not one of my settings, but it still doesn’t work. Does anyone have the same issue?

Steps to Reproduce

create main.py with

def foo(a, b):
    if a > b:
        return a
    else:
        return b


class Bar:
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def foo(self):
        return self.a + self.b


print(foo(1, 2))


def bar(a, b):
    return a - b


print(bar(1, 2))

Move cursor to the middle of the “self.b = b” line

Start hitting Control+Shift+right

Note

I reproduced the same broken behavour in VSCode by removing ms-python.vscode-pylance extension

Cursor Demo:

Expected Behavior

before selecting the whole file content the method and then the class is selected first

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.4
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T16:53:59.659Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

2 Likes

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.