diff options
Diffstat (limited to 'src/assert.cc')
| -rw-r--r-- | src/assert.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/assert.cc b/src/assert.cc index 1e5542ee..5f8a3f9d 100644 --- a/src/assert.cc +++ b/src/assert.cc @@ -28,21 +28,12 @@ private: bool notify_fatal_error(StringView msg) { #if defined(__CYGWIN__) - int res = MessageBox(NULL, msg.zstr(), "Kakoune: fatal error", - MB_OKCANCEL | MB_ICONERROR); - switch (res) - { - case IDCANCEL: - return false; - case IDOK: - return true; - } + return MessageBox(NULL, msg.zstr(), "Kakoune: fatal error", + MB_OKCANCEL | MB_ICONERROR) == IDOK; #elif defined(__linux__) auto cmd = format("xmessage -buttons 'quit:0,ignore:1' '{}'", msg); - if (system(cmd.c_str()) == 1) - return true; + return system(cmd.c_str()) == 1; #endif - return false; } void on_assert_failed(const char* message) |
