You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (GUI::MessageBox::show(window(), "Save changes to current file first?", "Warning", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel) != GUI::Dialog::ExecResult::ExecOK)
GUI::MessageBox::show(window(), String::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not found", GUI::MessageBox::Type::Warning);
144
+
return;
145
+
}
146
+
147
+
GUI::MessageBox::show(window(), String::formatted("Found {} matches for \"{}\" in this file", matches.size(), m_search_text), String::formatted("{} matches", matches.size()), GUI::MessageBox::Type::Warning);
148
+
set_search_results_visible(true);
149
+
} else {
150
+
bool same_buffers = false;
151
+
if (old_buffer.size() == m_search_buffer.size()) {
152
+
if (memcmp(old_buffer.data(), m_search_buffer.data(), old_buffer.size()) == 0)
153
+
same_buffers = true;
154
+
}
121
155
122
-
bool same_buffers = false;
123
-
if (old_buffer.size() == m_search_buffer.size()) {
124
-
if (memcmp(old_buffer.data(), m_search_buffer.data(), old_buffer.size()) == 0)
125
-
same_buffers = true;
126
-
}
156
+
auto result = m_editor->find_and_highlight(m_search_buffer, same_buffers ? last_found_index() : 0);
127
157
128
-
auto result = m_editor->find_and_highlight(m_search_buffer, same_buffers ? last_found_index() : 0);
158
+
if (result == -1) {
159
+
GUI::MessageBox::show(window(), String::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not found", GUI::MessageBox::Type::Warning);
160
+
return;
161
+
}
129
162
130
-
if (result == -1) {
131
-
GUI::MessageBox::show(window(), String::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not found", GUI::MessageBox::Type::Warning);
auto result = GUI::MessageBox::show(window(), "The file has been modified. Quit without saving?", "Quit without saving?", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
0 commit comments