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: text_input.rs
    path of file: ./repos/lapce/lapce-app/src
    
    the code of the file until where you have to start completion: use std::sync::Arc;

use floem::{
    action::{set_ime_allowed, set_ime_cursor_area},
    context::EventCx,
    cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout},
    event::{Event, EventListener},
    id::Id,
    peniko::{
        kurbo::{Line, Point, Rect, Size, Vec2},
        Color,
    },
    prop_extractor,
    reactive::{create_effect, create_memo, create_rw_signal, ReadSignal, RwSignal},
    style::{
        CursorStyle, FontFamily, FontSize, FontStyle, FontWeight, LineHeight,
        PaddingLeft, Style, TextColor,
    },
    taffy::prelude::NodeId,
    unit::PxPct,
    view::{AnyWidget, View, ViewData, Widget},
    views::Decorators,
    EventPropagation, Renderer,
};
use lapce_core::{
    buffer::rope_text::RopeText,
    cursor::{Cursor, CursorMode},
    selection::Selection,
};

use crate::{
    config::{color
    
    fn clamp_text_viewport(&mut self, text_viewport: Rect) {
        let text_rect = self.text_rect;
        let actual_size = text_rect.size();
        let width = text_rect.width();
        let height = text_rect.height();
        let child_size = self
            .text_layout
            .with_untracked(|text_layout| text_layout.as_ref().unwrap().size());

        let mut text_viewport = text_viewport;
        if width >= child_size.width {
            text_viewport.x0 = 0.0;
        } else if text_viewport.x0 > child_size.width - width {
            text_viewport.x0 = child_size.width - width;
        } else if text_viewport.x0 < 0.0 {
            text_viewport.x0 = 0.0;
        }

        if height >= child_size.height {
            text_viewport.y0 = 0.0;
        } else if text_viewport.y0 > child_size.height - height {
            text_viewport.y0 = child_size.height - height;
        } else if text_viewport.y0 < 0.0 {
            text_viewport.y0 = 0.0;
        }

        let text_viewport = text_viewport.with_size(actual_size);
        if text_viewport != self.text_viewport {
            self.text_viewport = text_viewport;
            self.id.request_paint();
        }
    }