code: func (edit *TextEditor) DeleteSelection() {
  	/* delete the section */
  	edit.clamp()
  
  	if edit.hasSelection() {
  		if edit.SelectStart < edit.SelectEnd {
  			edit.Delete(edit.SelectStart, edit.SelectEnd-edit.SelectStart)
  			edit.Cursor = edit.SelectStart
  			edit.SelectEnd = edit.Cursor
  		} else {
  			edit.Delete(edit.SelectEnd, edit.SelectStart-edit.SelectEnd)
  			edit.Cursor = edit.SelectEnd
  			edit.SelectStart = edit.Cursor
  		}
  
  		edit.HasPreferredX = false
  	}
  }
docs: // Deletes selection.