Skip to content

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Jan 24, 2026

Description

Consider both the first and last letter of the user's text when choosing case for completion candidates when keyword_casing=auto.

The issue is that when the last character typed is non-alphabetic such as underscore, then islower() is False. Better to check both the first and last character of the user's text. If either of them is lowercase then we complete with lowercase.

Fixes #1462 .

last image

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv run ruff check && uv run ruff format && uv run mypy --install-types . to lint and format the code.

Copy link
Contributor

@scottnemes scottnemes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Consider both the first and last letter of the user's text when
choosing case for completion candidates when keyword_casing=auto.

The issue is that when the last character typed is non-alphabetic
such as underscore, then islower() is False.  Better to check both the
first and last character of the user's text.  If either of them is
lowercase then we complete with lowercase.
@rolandwalker rolandwalker force-pushed the RW/better-auto-casing-heuristic branch from efc1c29 to 8407a30 Compare January 24, 2026 19:27
@rolandwalker rolandwalker merged commit 388397b into main Jan 24, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/better-auto-casing-heuristic branch January 24, 2026 19:31
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.

Auto complete suggestions change case

3 participants