Skip to content

[Python] Fix first case statement termination#4440

Merged
deathaxe merged 1 commit intosublimehq:masterfrom
deathaxe:pr/python/fix-first-case-termination
Feb 25, 2026
Merged

[Python] Fix first case statement termination#4440
deathaxe merged 1 commit intosublimehq:masterfrom
deathaxe:pr/python/fix-first-case-termination

Conversation

@deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Feb 9, 2026

This PR ...

  1. fixes first incomplete case statement failing valid 2nd case statement due to calling fail outside of a branch point. That's caused by first case statement re-using contexts of common case statements.

  2. fixes first statement after match ...: being scoped wrong, when starting with case soft keyword, by implementing first case statement with same branching strategy as all other ones.

Notes:

  1. As a side effect all case statements are highlighted the same way.
  2. Previously introduced special context after-first-case-statement becomes obsolete and is removed.

This commit ...

1. fixes first incomplete case statement failing valid 2nd case statement
   due to calling `fail` outside of a branch point. That's caused by first
   case statement re-using contexts of common case statements.

2. fixes first statement after `match ...:` being scoped wrong, when starting
   with `case` soft keyword, by implementing first case statement with same
   branching strategy as all other ones.

Notes:

1. As a side effect all case statements are highlighted the same way.
2. Previously introduced special context `after-first-case-statement`
   becomes obsolete and is removed.
@deathaxe deathaxe merged commit 8bc8354 into sublimehq:master Feb 25, 2026
2 checks passed
@deathaxe deathaxe deleted the pr/python/fix-first-case-termination branch February 25, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants