"""
Greedy_Delete.py - Deletes until non-whitespace character is at the
caret or the caret is at the end of the buffer.

Copyright (C) 2003 Ollie Rutherfurd <oliver@rutherfurd.net>

$Id
"""

def greedyDelete(textArea):
	textArea.delete()
	while 1:
		if textArea.getCaretPosition() == textArea.getBuffer().getLength():
			break
		c = textArea.getText(textArea.getCaretPosition(),1)
		if c not in (' ', '\t', '\n'):
			break
		textArea.delete()

if __name__ in ('__main__','main'):
	greedyDelete(init.textArea)

# :indentSize=4:lineSeparator=\n:maxLineLen=72:noTabs=false:tabSize=4:wrap=hard:

