Skip to content

Commit 1ffc8fe

Browse files
committed
Merge branch 'master' into develop
2 parents d31334c + d4ded13 commit 1ffc8fe

36 files changed

Lines changed: 394 additions & 249 deletions

NEWS.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ Bug Fixes:
6060
## lnav v0.14.1
6161

6262
Features:
63-
* Added the `:reload-view` command, bound to `F5`, that
64-
re-runs the operation that populated the current view.
63+
* Added the `:reload-view` command, bound to `F5`/`⌘-R`,
64+
that re-runs the operation that populated the current
65+
view.
6566
In the DB view, this re-executes the last SQL query; in
6667
the TIMELINE view, it rebuilds the index. Views that
6768
don't have a meaningful reload report an error.
@@ -77,12 +78,12 @@ Features:
7778
* For terminals that support the Kitty Keyboard
7879
protocol, the following hotkeys are now supported
7980
in the prompt:
80-
- ⌘-C to copy the current selection to the
81-
clipboard.
82-
- ⌘-A to select all text.
83-
- ⌘-X to cut the current selection to the
84-
clipboard.
85-
- ⌘-Z to undo the last change.
81+
- `⌘-C` to copy the current selection to the
82+
clipboard.
83+
- `⌘-A` to select all text.
84+
- `⌘-X` to cut the current selection to the
85+
clipboard.
86+
- `⌘-Z` to undo the last change.
8687
* The `measure_with_units` collator now recognizes
8788
(KiB, MiB, ...).
8889

src/command_executor.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,6 @@ execute_sql(exec_context& ec, const std::string& sql, std::string& alt_msg)
637637
auto& dls = *(ec.ec_label_source_stack.back());
638638
if (!dls.dls_row_cursors.empty()) {
639639
lnav_data.ld_views[LNV_DB].reload_data();
640-
lnav_data.ld_views[LNV_DB].set_selection(0_vl);
641-
lnav_data.ld_views[LNV_DB].set_left(0);
642640
if (lnav_data.ld_flags.is_set<lnav_flags::headless>()) {
643641
retval = "";
644642
alt_msg = "";

src/db_status_source.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ db_status_source::update_from_db_source()
7676
changed |= this->dss_fields[DSF_RELOAD].set_value(reload_al);
7777

7878
attr_line_t query_al;
79-
query_al.append(" ;").append(dls.dls_user_query);
79+
query_al.append(";").append(dls.dls_user_query);
8080
readline_sql_highlighter(
8181
query_al, lnav::sql::dialect::sqlite, std::nullopt);
8282
changed |= this->dss_fields[DSF_QUERY].set_value(query_al);

src/field_overlay_source.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,15 @@ field_overlay_source::add_key_line_attrs(int key_size, bool last_line)
10261026
sa.emplace_back(lr, VC_STYLE.value(text_attrs::with_bold()));
10271027
}
10281028

1029+
void
1030+
field_overlay_source::reset()
1031+
{
1032+
this->fos_anno_cache.clear();
1033+
this->fos_static_lines.clear();
1034+
this->fos_lines.clear();
1035+
this->fos_meta_lines.clear();
1036+
}
1037+
10291038
void
10301039
field_overlay_source::list_value_for_overlay(
10311040
const listview_curses& lv,

src/field_overlay_source.hh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ public:
5151

5252
void add_key_line_attrs(int key_size, bool last_line = false);
5353

54-
void reset() override
55-
{
56-
this->fos_lines.clear();
57-
this->fos_meta_lines.clear();
58-
}
54+
void reset() override;
5955

6056
bool list_static_overlay(const listview_curses& lv,
6157
media_t media,

src/hotkeys.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ handle_paging_key(notcurses* nc, const ncinput& ch, const char* keyseq)
205205
return true;
206206
}
207207

208+
if (ncinput_alt_p(&ch) || ncinput_super_p(&ch)) {
209+
return false;
210+
}
211+
208212
auto* lss = dynamic_cast<logfile_sub_source*>(tc_tss);
209213
auto* text_accel_p = dynamic_cast<text_accel_source*>(tc_tss);
210214

src/keymaps/default-keymap.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"f5": {
2727
"command": ":reload-view"
2828
},
29+
"cmd-x72": {
30+
"command": ":reload-view"
31+
},
2932
"f7": {
3033
"command": "|lnav-moveto-breakpoint prev"
3134
},

src/lnav.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,6 +3032,7 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
30323032
for (auto& tc : lnav_data.ld_views) {
30333033
tc.deinit();
30343034
}
3035+
log_fos.reset();
30353036

30363037
log_info("marking files as closed");
30373038
for (auto& lf : lnav_data.ld_active_files.fc_files) {

src/logfile.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ logfile::open(std::filesystem::path filename,
142142

143143
lf_fd.close_on_exec();
144144

145-
log_info("Creating logfile: fd=%d; size=%" PRId64 "; mtime=%" PRId64
145+
log_info("Creating logfile(%p): fd=%d; size=%" PRId64 "; mtime=%" PRId64
146146
"; filename=%s",
147+
lf.get(),
147148
(int) lf_fd,
148149
(long long) lf->lf_stat.st_size,
149150
(long long) lf->lf_stat.st_mtime,
@@ -254,7 +255,9 @@ logfile::logfile(std::filesystem::path filename,
254255

255256
logfile::~logfile()
256257
{
257-
log_info("destructing logfile: %s", this->lf_filename_as_string.c_str());
258+
log_info("destructing logfile(%p): %s",
259+
this,
260+
this->lf_filename_as_string.c_str());
258261
}
259262

260263
bool

src/logfile.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public:
115115
const logfile_open_options& loo,
116116
auto_fd fd = auto_fd{});
117117

118+
logfile(const logfile&) = delete;
119+
logfile& operator=(const logfile&) = delete;
120+
118121
~logfile() override;
119122

120123
const logfile_activity& get_activity() const { return this->lf_activity; }

0 commit comments

Comments
 (0)