HF RL Explorer

You are working on the prompt-toolkit/python-prompt-toolkit repository. The source code is checked out at…

You are working on the prompt-toolkit/python-prompt-toolkit repository. The source code is checked out at…: a task in SWE-Lego-RL-2699 (Harbor dataset). Document.get word before cursor() incorrectly returns string containing trailing whitespace when a pattern value is provided.

The task

`Document.get_word_before_cursor()` incorrectly returns string containing trailing whitespace when a `pattern` value is provided.

Part of Lego-X/Lego-RL-2699.