···101101102102let sub' str p l = if p = 0 && l = String.length str then str else String.sub str p l
103103104104-let edit_field ?(focus = Focus.make ()) state ~on_change ~on_submit =
104104+let edit_field ?(focus = Focus.make ()) ?(attr_focused = A.(empty)) state ~on_change ~on_submit =
105105 let update focus_h focus (text, pos) =
106106 let pos = clampi pos ~min:0 ~max:(String.length text) in
107107 let content =
···110110 @@
111111 if Focus.has_focus focus
112112 then (
113113- let attr = A.(st italic) in
113113+ (* sets the styling when focused *)
114114+ let attr = A.(attr_focused ++ st underline) in
114115 let len = String.length text in
115116 (if pos >= len
116117 then [ I.string attr text ]