summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-01-22 22:35:01 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-01-22 22:35:01 +0100
commite3b572e8ee9c1400eea172dd2b53c00f1eaa9f98 (patch)
tree65df017cda44789cc8a53e49ffee88d0918e798e
parent2832b5f1932a5c8c964a143782c381c819aa3625 (diff)
downloadsave-e3b572e8ee9c1400eea172dd2b53c00f1eaa9f98.tar.gz
Small improvements.HEADmaster
-rw-r--r--save.pl15
1 files changed, 6 insertions, 9 deletions
diff --git a/save.pl b/save.pl
index fd51325..0e87699 100644
--- a/save.pl
+++ b/save.pl
@@ -38,12 +38,11 @@ init :-
added(S) :-
dif(S, 0),
- !,
send(@display, report, error,
'Files could not be added to index. Ensure Git is in PATH
and that the current directory is a Git repository.').
-added(_) :-
+added(0) :-
%send(@pce, load_defaults, 'Defaults'),
% Right side.
@@ -52,9 +51,7 @@ added(_) :-
refresh,
% Left side.
- send(@dialog, append, text('Comment (optional):',
- left,
- bold)),
+ send(@dialog, append, text('Comment (optional):', left, bold)),
send(@dialog, append, @editor),
send(@dialog, append, @save_button),
send(@dialog, append, @refresh_button),
@@ -118,14 +115,14 @@ commit(Msg) :-
process_create(path(git), ['commit', '-m', Msg],
[process(PID)]),
process_wait(PID, S),
- commited(S).
+ committed(S).
-commited(S) :-
+committed(S) :-
dif(S, exit(0)),
dif(S, exit(128)),
- !,
send(@display, report, error,
'Files could not be saved.').
-commited(_) :-
+committed(exit(N)) :-
+ member(N, [0,128]),
send(@dialog, destroy).