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)
17
17
{
18
18
_onSave = msg => File . WriteAllText ( file , msg ) ;
19
19
_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 ( ) ;
21
26
}
22
27
23
28
public void AsBuiltin ( string msg , Action < string > onSave )
24
29
{
25
30
_onSave = onSave ;
26
31
_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 ( ) ;
28
37
}
29
38
30
39
protected override void OnClosed ( EventArgs e )
You can’t perform that action at this time.
0 commit comments