File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use crate::{
1111use anyhow:: Result ;
1212use crossterm:: event:: { Event , KeyCode , KeyModifiers } ;
1313use itertools:: Itertools ;
14- use std:: ops:: Range ;
14+ use std:: { collections :: HashMap , ops:: Range } ;
1515use tui:: {
1616 backend:: Backend ,
1717 layout:: Rect ,
@@ -157,11 +157,20 @@ impl TextInputComponent {
157157 self . get_msg ( self . cursor_position ..pos)
158158 } ) ;
159159
160- if cursor_str == "\n " {
160+ let cursor_highlighting = {
161+ let mut h = HashMap :: with_capacity ( 2 ) ;
162+ h. insert ( "\n " , "\u{21b5} \n \r " ) ;
163+ h. insert ( " " , "\u{00B7} " ) ;
164+ h
165+ } ;
166+
167+ if let Some ( substitute) =
168+ cursor_highlighting. get ( cursor_str. as_str ( ) )
169+ {
161170 txt = text_append (
162171 txt,
163172 Text :: styled (
164- " \u{21b5} \n \r " ,
173+ substitute . clone ( ) ,
165174 self . theme
166175 . text ( false , false )
167176 . add_modifier ( Modifier :: UNDERLINED ) ,
You can’t perform that action at this time.
0 commit comments