File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,23 @@ public void AsStandalone(string file)
1717 {
1818 _onSave = msg => File . WriteAllText ( file , msg ) ;
1919 _shouldExitApp = true ;
20- Editor . Text = File . ReadAllText ( file ) . ReplaceLineEndings ( "\n " ) . Trim ( ) ;
20+
21+ var content = File . ReadAllText ( file ) . ReplaceLineEndings ( "\n " ) . Trim ( ) ;
22+ var parts = content . Split ( '\n ' , 2 ) ;
23+ Editor . SubjectEditor . Text = parts [ 0 ] ;
24+ if ( parts . Length > 1 )
25+ Editor . DescriptionEditor . Text = parts [ 1 ] . Trim ( ) ;
2126 }
2227
2328 public void AsBuiltin ( string msg , Action < string > onSave )
2429 {
2530 _onSave = onSave ;
2631 _shouldExitApp = false ;
27- Editor . Text = msg . Trim ( ) ;
32+
33+ var parts = msg . Split ( '\n ' , 2 ) ;
34+ Editor . SubjectEditor . Text = parts [ 0 ] ;
35+ if ( parts . Length > 1 )
36+ Editor . DescriptionEditor . Text = parts [ 1 ] . Trim ( ) ;
2837 }
2938
3039 protected override void OnClosed ( EventArgs e )
You can’t perform that action at this time.
0 commit comments