File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ func save():
38
38
if text .length () > 0 and text .substr (text .length ()- 1 , 1 ) != "\n " :
39
39
text += "\n "
40
40
41
- _client_connection .put_string (text )
41
+ # Prefix with an 's' to say that this is a "save", not a "close".
42
+ _client_connection .put_string ("s" + text )
42
43
43
44
emit_signal ("saved" )
44
45
close ()
Original file line number Diff line number Diff line change @@ -28,10 +28,12 @@ my $new_content = "";
28
28
$socket -> recv ($new_content , $length );
29
29
30
30
# Write content back into the file.
31
- my $handle ;
32
- open ($handle ,' >' ,$absolute_path ) or die (" Error opening file" );
33
- print $handle $new_content ;
34
- close ($handle ) or die (" Error closing file" );
31
+ if ($new_content =~ / ^s/ ) {
32
+ my $handle ;
33
+ open ($handle ,' >' ,$absolute_path ) or die (" Error opening file" );
34
+ print $handle (substr $new_content , 1);
35
+ close ($handle ) or die (" Error closing file" );
36
+ }
35
37
36
38
# This call is intended to block, we're waiting for Godot to close the connection.
37
39
my $reply ;
You can’t perform that action at this time.
0 commit comments