From e3b572e8ee9c1400eea172dd2b53c00f1eaa9f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 22 Jan 2022 22:35:01 +0100 Subject: Small improvements. --- save.pl | 15 ++++++--------- 1 file 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). -- cgit v1.2.3