Skip to content

Commit

Permalink
[misc] fix win build and allow reopening a url
Browse files Browse the repository at this point in the history
  • Loading branch information
tstack committed May 22, 2024
1 parent 624a9a7 commit b14f684
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/base/paths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "config.h"

#ifdef __CYGWIN__
# include <algorithm>
# include <iostream>
# include <sstream>
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/lnav_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3121,6 +3121,7 @@ com_open(exec_context& ec, std::string cmdline, std::vector<std::string>& args)
isc::to<curl_looper&, services::curl_streamer_t>().send(
[ul](auto& clooper) { clooper.add_request(ul); });
lnav_data.ld_files_to_front.emplace_back(fn, file_loc);
closed_files.push_back(fn);
retval = "info: opened URL";
} else {
retval = "";
Expand Down Expand Up @@ -3279,6 +3280,9 @@ com_open(exec_context& ec, std::string cmdline, std::vector<std::string>& args)
files_to_front.emplace_back(fn, file_loc);

closed_files.push_back(fn);
if (!loo.loo_filename.empty()) {
closed_files.push_back(loo.loo_filename);
}
if (lnav_data.ld_rl_view != nullptr) {
lnav_data.ld_rl_view->set_alt_value(
HELP_MSG_1(X, "to close the file"));
Expand Down Expand Up @@ -3467,7 +3471,7 @@ com_open(exec_context& ec, std::string cmdline, std::vector<std::string>& args)
files_to_front.begin(),
files_to_front.end());
for (const auto& fn : closed_files) {
fc.fc_closed_files.erase(fn);
lnav_data.ld_active_files.fc_closed_files.erase(fn);
}

lnav_data.ld_active_files.merge(fc);
Expand Down

0 comments on commit b14f684

Please sign in to comment.