File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Userland/Libraries/LibLine Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -251,11 +251,13 @@ void Editor::add_to_history(DeprecatedString const& line)
251
251
252
252
bool Editor::load_history (DeprecatedString const & path)
253
253
{
254
- auto history_file = Core::DeprecatedFile::construct (path);
255
- if (!history_file-> open (Core::OpenMode::ReadOnly ))
254
+ auto history_file_or_error = Core::File::open (path, Core::File::OpenMode::Read );
255
+ if (history_file_or_error. is_error ( ))
256
256
return false ;
257
- auto data = history_file->read_all ();
258
- auto hist = StringView { data.data (), data.size () };
257
+ auto data_or_error = history_file_or_error.value ()->read_until_eof ();
258
+ if (data_or_error.is_error ())
259
+ return false ;
260
+ auto hist = StringView { data_or_error.value () };
259
261
for (auto & str : hist.split_view (" \n\n " sv)) {
260
262
auto it = str.find (" ::" sv).value_or (0 );
261
263
auto time = str.substring_view (0 , it).to_int <time_t >().value_or (0 );
You can’t perform that action at this time.
0 commit comments