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::{
11
11
use anyhow:: Result ;
12
12
use crossterm:: event:: { Event , KeyCode , KeyModifiers } ;
13
13
use itertools:: Itertools ;
14
- use std:: ops:: Range ;
14
+ use std:: { collections :: HashMap , ops:: Range } ;
15
15
use tui:: {
16
16
backend:: Backend ,
17
17
layout:: Rect ,
@@ -157,11 +157,20 @@ impl TextInputComponent {
157
157
self . get_msg ( self . cursor_position ..pos)
158
158
} ) ;
159
159
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
+ {
161
170
txt = text_append (
162
171
txt,
163
172
Text :: styled (
164
- " \u{21b5} \n \r " ,
173
+ substitute . clone ( ) ,
165
174
self . theme
166
175
. text ( false , false )
167
176
. add_modifier ( Modifier :: UNDERLINED ) ,
You can’t perform that action at this time.
0 commit comments