Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions prompt_toolkit/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ def find_backwards(self, sub, in_current_line=False, count=1):
except StopIteration:
pass

def get_word_before_cursor(self):
def get_word_before_cursor(self, WORD=False):
"""
Give the word before the cursor.
If we have whitespace before the cursor this returns an empty string.
"""
if self.text_before_cursor[-1:].isspace():
return ''
else:
return self.text_before_cursor[self.find_start_of_previous_word():]
return self.text_before_cursor[self.find_start_of_previous_word(WORD=WORD):]

def find_start_of_previous_word(self, count=1, WORD=False):
"""
Expand Down