Skip to content

Commit 6c54756

Browse files
committed
reverted - Shortcut bug breaking hexeditor 2
1 parent 2a79e96 commit 6c54756

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Terminal.Gui/Views/NumericUpDown.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,19 @@ public NumericUpDown ()
9292
Add (_down, _number, _up);
9393

9494
AddCommand (
95-
Command.ScrollUp,
95+
Command.Up,
9696
(ctx) =>
9797
{
9898
if (type == typeof (object))
9999
{
100100
return false;
101101
}
102102

103-
if (RaiseSelecting (ctx) is true)
104-
{
105-
return true;
106-
}
103+
// BUGBUG: If this is uncommented, the numericupdown in a shortcut will not work
104+
//if (RaiseSelecting (ctx) is true)
105+
//{
106+
// return true;
107+
//}
107108

108109
if (Value is { } && Increment is { })
109110
{
@@ -114,18 +115,19 @@ public NumericUpDown ()
114115
});
115116

116117
AddCommand (
117-
Command.ScrollDown,
118+
Command.Down,
118119
(ctx) =>
119120
{
120121
if (type == typeof (object))
121122
{
122123
return false;
123124
}
124125

125-
if (RaiseSelecting (ctx) is true)
126-
{
127-
return true;
128-
}
126+
// BUGBUG: If this is uncommented, the numericupdown in a shortcut will not work
127+
//if (RaiseSelecting (ctx) is true)
128+
//{
129+
// return true;
130+
//}
129131

130132
if (Value is { } && Increment is { })
131133
{
@@ -136,22 +138,22 @@ public NumericUpDown ()
136138
return true;
137139
});
138140

139-
KeyBindings.Add (Key.CursorUp, Command.ScrollUp);
140-
KeyBindings.Add (Key.CursorDown, Command.ScrollDown);
141+
KeyBindings.Add (Key.CursorUp, Command.Up);
142+
KeyBindings.Add (Key.CursorDown, Command.Down);
141143

142144
SetText ();
143145

144146
return;
145147

146148
void OnDownButtonOnAccept (object? s, CommandEventArgs e)
147149
{
148-
InvokeCommand (Command.ScrollDown);
150+
InvokeCommand (Command.Down);
149151
e.Cancel = true;
150152
}
151153

152154
void OnUpButtonOnAccept (object? s, CommandEventArgs e)
153155
{
154-
InvokeCommand (Command.ScrollUp);
156+
InvokeCommand (Command.Up);
155157
e.Cancel = true;
156158
}
157159
}

0 commit comments

Comments
 (0)