You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: textinput.rs
    path of file: ./repos/gitui/src/components
    
    the code of the file until where you have to start completion: use crate::app::Environment;
use crate::keys::key_match;
use crate::ui::Size;
use crate::{
	components::{
		visibility_blocking, CommandBlocking, CommandInfo, Component,
		DrawableComponent, EventState,
	},
	keys::SharedKeyConfig,
	strings,
	ui::{self, style::SharedTheme},
};
use anyhow::Result;
use crossterm::event::Event;
use ratatui::widgets::{Block, Borders};
use ratatui::{
	layout::{Alignment, Rect},
	widgets::{Clear, Paragraph},
	Frame,
};
use std::cell::Cell;
use std::cell:
    
	fn should_select(&mut self, input: &Input) {
		if input.key == Key::Null {
			return;
		}
		// Should we start selecting text, stop the current selection, or do nothing?
		// the end is handled after the ending keystroke

		match (&self.select_state, input.shift) {
			(SelectionState::Selecting, true)
			| (SelectionState::NotSelecting, false) => {
				// continue selecting or not selecting
			}
			(SelectionState::Selecting, false) => {
				// end select
				self.select_state =
					SelectionState::SelectionEndPending;
			}
			(SelectionState::NotSelecting, true) => {
				// start select
				// this should always work since we are only called
				// if we have a textarea to get input
				if let Some(ta) = &mut self.textarea {
					ta.start_selection();
					self.select_state = SelectionState::Selecting;
				}
			}
			(SelectionState::SelectionEndPending, _) => {
				// this really should not happen because the end pending state
				// should have been picked up in the same pass as it was set
				// so lets clear it
				self.select_state = SelectionState::NotSelecting;
			}
		}
	}