Skip to content

Commit e930385

Browse files
committed
[vt52] fix key handling
1 parent f785e4d commit e930385

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/column_namer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "config.h"
3939
#include "sql_util.hh"
4040

41-
const auto column_namer::BUILTIN_COL = string_fragment::from_const("col");
41+
const string_fragment column_namer::BUILTIN_COL = string_fragment::from_const("col");
4242

4343
column_namer::column_namer(language lang) : cn_language(lang)
4444
{

src/grep_proc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ grep_proc<LineType>::child_loop()
197197
// When scanning to the end of the source, we need to return the
198198
// highest line that was seen so that the next request that
199199
// continues from the end works properly.
200-
fmt::println(stdout, FMT_STRING("h%d"), line - 1);
200+
fmt::println(stdout, FMT_STRING("h{}"), line - 1);
201201
}
202202
this->gp_highest_line = line - 1_vl;
203203
this->child_term();

src/vt52_curses.cc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,26 @@ string_fragment
132132
vt52_curses::map_input(const ncinput& ch)
133133
{
134134
/* Check for an escape sequence, otherwise just return the char. */
135-
const auto esc = vt52_escape_map::singleton()[ch.id];
136-
if (esc) {
137-
return esc.value();
135+
if (ch.modifiers == 0) {
136+
const auto esc = vt52_escape_map::singleton()[ch.id];
137+
if (esc) {
138+
return esc.value();
139+
}
138140
}
139141
if (ch.id == 0x7f) {
140142
this->vc_map_buffer = static_cast<char>(ch.id);
141143
return string_fragment::from_c_str(&this->vc_map_buffer);
142144
}
143145

144-
if (ncinput_shift_p(&ch) && ch.id == NCKEY_LEFT) {
146+
if ((ncinput_shift_p(&ch) || ncinput_ctrl_p(&ch) || ncinput_alt_p(&ch))
147+
&& ch.id == NCKEY_LEFT)
148+
{
145149
return string_fragment::from_const("\033b");
146150
}
147151

148-
if (ncinput_shift_p(&ch) && ch.id == NCKEY_RIGHT) {
152+
if ((ncinput_shift_p(&ch) || ncinput_ctrl_p(&ch) || ncinput_alt_p(&ch))
153+
&& ch.id == NCKEY_RIGHT)
154+
{
149155
return string_fragment::from_const("\033f");
150156
}
151157

0 commit comments

Comments
 (0)