How to use large context on Inline editing

GPT-4 turbo (gpt4-turbo-2024-04-09) has 128K token context window, and Claude Opus (claude-3-opus-20240229) has 200K.

However, when I select code (inline editing / CTRL+K) with more than ~2,500 token, one of the following happens:

  • The editing stops in the middle (usually after around 2,500 tokens).
  • The edit skips a lot of lines and writes “{X} lines omitted…”
  • The editing gets stuck (simply doesn’t continue)

Both OpenAI API key and Anthropic API key are present in their respective inputs in the Cursor settings, and both toggles are on. Also, I have “Long Context Chat (Beta)” enabled in the Cursor settings.

Am I doing something wrong? How can I solve this?

Inline editing is the feature I use most in Cursor, and currently I need to divide the code I want to edit into chunks of ~2,500 tokens.