@@ -12,8 +12,8 @@ pub use cosmic_text::Motion;
1212use cosmic_text:: { Action , BorrowedWithFontSystem , Edit , Editor , Selection } ;
1313
1414use crate :: {
15- get_cosmic_text_buffer_contents, CosmicFontSystem , TextInputAttributes ,
16- TextInputBuffer , TextInputFilter , TextInputValue ,
15+ get_cosmic_text_buffer_contents, CosmicFontSystem , TextInputAttributes , TextInputBuffer ,
16+ TextInputFilter , TextInputValue ,
1717} ;
1818
1919/// Text input commands queue
@@ -198,7 +198,8 @@ pub fn apply_text_edits(
198198 clipboard. as_mut ( ) ,
199199 & action,
200200 ) {
201- commands. trigger_targets ( TextInputEvent :: InvalidEdit ( error, action) , entity) ;
201+ commands
202+ . trigger_targets ( TextInputEvent :: InvalidEdit ( error, action) , entity) ;
202203 }
203204 }
204205 }
@@ -231,15 +232,14 @@ pub fn apply_text_edit(
231232 clipboard : Option < & mut ResMut < Clipboard > > ,
232233 edit : & TextEdit ,
233234) -> Result < ( ) , InvalidTextEditError > {
234-
235235 editor. start_change ( ) ;
236236
237237 match edit {
238238 TextEdit :: Copy => {
239- if let Some ( text) = editor. copy_selection ( ) {
240- if let Some ( clipboard) = clipboard {
241- let _ = clipboard . set_text ( text ) ;
242- }
239+ if let Some ( text) = editor. copy_selection ( )
240+ && let Some ( clipboard) = clipboard
241+ {
242+ let _ = clipboard . set_text ( text ) ;
243243 }
244244 }
245245 TextEdit :: Cut => {
@@ -379,7 +379,6 @@ pub fn apply_text_edit(
379379 Ok ( ( ) )
380380}
381381
382-
383382/// Automatically propagated events that can be dispatched by a text input entity.
384383#[ derive( EntityEvent , Clone , Debug , Component ) ]
385384#[ entity_event( traversal = & ' static ChildOf , auto_propagate) ]
0 commit comments