Skip to content

Commit 4bed426

Browse files
committed
COMMON: fix form regression
1 parent 982d83e commit 4bed426

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

samples/distro-examples/apps/calc.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func showResult(result)
209209
rect out_x, out_y STEP w, h, COLOR bgnd FILLED
210210
rect out_x - 1, out_y - 1 STEP w + 1, h + 1, COLOR 2
211211

212-
local out_str = chr(27) + "[15 C" + result
212+
local out_str = result
213213
local out_str_w = textwidth(result)
214214
local x = (out_x + w) - out_str_w - textwidth("0")
215215

samples/distro-examples/examples/Circles_and_arcs.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
color 0,15
1+
color 1,2:cls
22
circle ymax/4,ymax/4,ymax/8
33
circle ymax/2,ymax/4,ymax/8 FILLED
44
circle ymax/4,ymax/2,ymax/8,.75

samples/distro-examples/examples/Predefined_Variables.bas

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
? cat(1);"Predefined Variables";cat(0)
2-
? "OS VER =0x"; HEX$(osver)
3-
? "SB VER =0x"; HEX$(sbver)
2+
? "SB VER ="; sbver
43
? "PI ="; pi
54
? "XMAX ="; xmax
65
? "YMAX ="; ymax

samples/distro-examples/graphics/Charts.bas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
' CHART examples
33

44
const VN=10
5+
const LINECHART=1
6+
const BARCHART=2
57
dim v(1 to VN)
6-
78
randomize timer
89

910
cls

samples/distro-examples/graphics/Simple_3D.bas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ for i=1 to 15
3333
calcPt
3434
line sx,sy
3535
next
36+
showpage
3637
end
3738

3839
'

src/platform/sdl/editor.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ using namespace strlib;
1919
String g_exportAddr;
2020
String g_exportToken;
2121
int cursorPos;
22+
bool returnToLine;
2223

2324
void onlineHelp(Runtime *runtime, TextEditInput *widget) {
2425
char path[100];
@@ -109,7 +110,12 @@ void System::editSource(String loadPath) {
109110
editWidget->updateUI(NULL, NULL);
110111
editWidget->setLineNumbers();
111112
editWidget->setFocus(true);
112-
editWidget->setCursorPos(cursorPos);
113+
114+
if (isBreak() && returnToLine) {
115+
editWidget->setCursorRow(gsb_last_line);
116+
} else {
117+
editWidget->setCursorPos(cursorPos);
118+
}
113119
cursorPos = 0;
114120

115121
if (gsb_last_error && !isBack()) {
@@ -285,6 +291,12 @@ void System::editSource(String loadPath) {
285291
widget = helpWidget;
286292
showRecentFiles(helpWidget, loadPath);
287293
break;
294+
case SB_KEY_ALT('.'):
295+
returnToLine = !returnToLine;
296+
_output->setStatus(returnToLine ?
297+
"Position the cursor to the last program line after BREAK" :
298+
"BREAK restores current cursor position");
299+
break;
288300
case SB_KEY_ALT('1'):
289301
case SB_KEY_ALT('2'):
290302
case SB_KEY_ALT('3'):

src/ui/form.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ void cmd_form_do_events(var_s *self) {
144144
focusInput->edit(event.key, sw, charWidth)) {
145145
dev_clrkb();
146146
out->setDirty();
147-
} else if (event.key == SB_KEY_MK_PUSH || event.key == SB_KEY_MK_RELEASE ||
148-
SB_KEY_CTRL(SB_KEY_UP) || SB_KEY_CTRL(SB_KEY_DOWN)) {
147+
} else if (event.key == SB_KEY_MK_PUSH ||
148+
event.key == SB_KEY_MK_RELEASE ||
149+
event.key == (int)SB_KEY_CTRL(SB_KEY_UP) ||
150+
event.key == (int)SB_KEY_CTRL(SB_KEY_DOWN)) {
149151
// no exit on mouse events
150152
dev_clrkb();
151153
} else {

src/ui/textedit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const char *helpText =
103103
"A-g goto line\n"
104104
"A-n trim line-endings\n"
105105
"A-t select theme\n"
106+
"A-. break mode\n"
106107
"A-<n> recent file\n"
107108
"SHIFT-<arrow> select\n"
108109
"TAB indent line\n"

0 commit comments

Comments
 (0)