Command_Close
This commit is contained in:
@@ -417,12 +417,10 @@ void OnCommand(Event event) {
|
||||
continue;
|
||||
}
|
||||
if (it->dirty) {
|
||||
String message = Format(scratch, "Do you really want to quit? Unsaved buffer: %S", it->name);
|
||||
int save = SaveMessageBox("There are unsaved changes, do you really want to quit!", message.data);
|
||||
int save = SaveMessageBox(it->name);
|
||||
if (save == 0) {
|
||||
break;
|
||||
}
|
||||
if (save == 2) {
|
||||
} else if (save == 2) {
|
||||
SaveBuffer(it);
|
||||
}
|
||||
}
|
||||
@@ -471,14 +469,16 @@ void GarbageCollect() {
|
||||
IterRemove(Views) {
|
||||
IterRemovePrepare(Views);
|
||||
|
||||
Buffer *buffer = GetBuffer(it->active_buffer);
|
||||
if (!buffer->garbage) {
|
||||
continue;
|
||||
}
|
||||
if (it->kill == 0) {
|
||||
Buffer *buffer = GetBuffer(it->active_buffer);
|
||||
if (!buffer->garbage) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool ref = ViewIsReferenced(it->id);
|
||||
if (ref) {
|
||||
continue;
|
||||
bool ref = ViewIsReferenced(it->id);
|
||||
if (ref) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
remove_item = true;
|
||||
@@ -489,13 +489,21 @@ void GarbageCollect() {
|
||||
IterRemove(Buffers) {
|
||||
IterRemovePrepare(Buffers);
|
||||
|
||||
if (!it->garbage) {
|
||||
|
||||
if (it->id.id == 0) {
|
||||
it->kill = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
bool ref = BufferIsReferenced(it->id);
|
||||
if (ref) {
|
||||
continue;
|
||||
if (it->kill == 0) {
|
||||
if (!it->garbage) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool ref = BufferIsReferenced(it->id);
|
||||
if (ref) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
remove_item = true;
|
||||
|
||||
Reference in New Issue
Block a user