1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 10:00:23 +00:00

Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
Luke Ceddia 2018-01-03 22:42:53 +11:00
commit 8917bf0e52
4 changed files with 271 additions and 58 deletions

View file

@ -12,6 +12,7 @@ DIM SHARED MouseButtonSwapped AS _BYTE
DIM SHARED PasteCursorAtEnd AS _BYTE
DIM SHARED SaveExeWithSource AS _BYTE
DIM SHARED IDEShowErrorsImmediately AS _BYTE
DIM SHARED ShowLineNumbersSeparator AS _BYTE, ShowLineNumbersUseBG AS _BYTE
IF LoadedIDESettings = 0 THEN
'We only want to load the file once when QB64 first starts
@ -204,6 +205,45 @@ IF LoadedIDESettings = 0 THEN
IDEShowErrorsImmediately = -1
END IF
result = ReadConfigSetting("ShowLineNumbers", value$)
IF result THEN
IF value$ = "TRUE" OR VAL(value$) = -1 THEN
ShowLineNumbers = -1
ELSE
ShowLineNumbers = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbers", "FALSE"
END IF
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbers", "FALSE"
ShowLineNumbers = 0
END IF
result = ReadConfigSetting("ShowLineNumbersSeparator", value$)
IF result THEN
IF value$ = "TRUE" OR VAL(value$) = -1 THEN
ShowLineNumbersSeparator = -1
ELSE
ShowLineNumbersSeparator = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersSeparator", "FALSE"
END IF
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersSeparator", "TRUE"
ShowLineNumbersSeparator = -1
END IF
result = ReadConfigSetting("ShowLineNumbersUseBG", value$)
IF result THEN
IF value$ = "TRUE" OR VAL(value$) = -1 THEN
ShowLineNumbersUseBG = -1
ELSE
ShowLineNumbersUseBG = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersUseBG", "FALSE"
END IF
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersUseBG", "TRUE"
ShowLineNumbersUseBG = -1
END IF
result = ReadConfigSetting("BracketHighlight", value$)
IF result THEN
IF value$ = "TRUE" OR VAL(value$) = -1 THEN

View file

@ -4,5 +4,5 @@ DIM SHARED AutoBuildMsg AS STRING
Version$ = "1.2"
'BuildNum format is YYYYMMDD/id, where id is a ever-increasing
'integer. If you make a change, update the date and increase the id!
BuildNum$ = "20171230/83"
BuildNum$ = "20180102/84"

View file

@ -166,8 +166,9 @@ DIM SHARED ModifyCOMMAND$
DIM SHARED EnteringRGB AS _BYTE
DIM SHARED ActiveINCLUDELink AS LONG
DIM SHARED ActiveINCLUDELinkFile AS STRING
DIM SHARED HideCurrentLineHighlight AS _BYTE
DIM SHARED idegotobox_LastLineNum AS LONG
DIM SHARED HideCurrentLineHighlight AS _BYTE, ShowLineNumbers AS _BYTE
DIM SHARED idegotobox_LastLineNum AS LONG, maxLineNumberLength AS LONG
'--------------------------------------------------------------------------------
TYPE idedbptype
x AS LONG
@ -206,6 +207,8 @@ DIM SHARED menus AS INTEGER, idecontextualmenuID AS INTEGER
DIM SHARED ideeditmenuID AS INTEGER
DIM SHARED OptionsMenuID AS INTEGER, OptionsMenuSwapMouse AS INTEGER, OptionsMenuPasteCursor AS INTEGER
DIM SHARED OptionsMenuShowErrorsImmediately AS INTEGER
DIM SHARED ViewMenuID AS INTEGER, ViewMenuShowLineNumbersSubMenuID AS INTEGER
DIM SHARED ViewMenuShowSeparatorID AS INTEGER, ViewMenuShowBGID AS INTEGER
DIM SHARED RunMenuID AS INTEGER, RunMenuSaveExeWithSource AS INTEGER, brackethighlight AS INTEGER
DIM SHARED multihighlight AS INTEGER, keywordHighlight AS INTEGER
DIM SHARED PresetColorSchemes AS INTEGER, TotalColorSchemes AS INTEGER, ColorSchemes$(0)

View file

@ -249,9 +249,10 @@ FUNCTION ide2 (ignore)
ideeditmenuID = m
IdeMakeEditMenu
m = m + 1: i = 0
m = m + 1: i = 0: ViewMenuID = m
menu$(m, i) = "View": i = i + 1
menu$(m, i) = "#SUBs... F2": i = i + 1
menu$(m, i) = "#Line numbers " + CHR$(16): i = i + 1
menusize(m) = i - 1
m = m + 1: i = 0
@ -277,7 +278,7 @@ FUNCTION ide2 (ignore)
menu$(m, i) = "-": i = i + 1
RunMenuSaveExeWithSource = i
menu$(m, i) = "Save EXE in the source #folder": i = i + 1
menu$(m, i) = "Output EXE to source #folder": i = i + 1
IF SaveExeWithSource THEN
menu$(RunMenuID, RunMenuSaveExeWithSource) = CHR$(7) + menu$(RunMenuID, RunMenuSaveExeWithSource)
END IF
@ -343,6 +344,22 @@ FUNCTION ide2 (ignore)
m = m + 1
idecontextualmenuID = m
'View Menu sub menu for Line Numbers options
m = m + 1: i = 0
menu$(m, i) = "ViewMenuShowLineNumbersSubMenu": i = i + 1
ViewMenuShowLineNumbersSubMenuID = m
IF ShowLineNumbers THEN menu$(m, i) = "#Hide line numbers" ELSE menu$(m, i) = "#Show line numbers"
i = i + 1
menu$(m, i) = "#Background color": IF ShowLineNumbersUseBG THEN menu$(m, i) = CHR$(7) + menu$(m, i)
ViewMenuShowBGID = i
IF ShowLineNumbers = 0 THEN menu$(m, i) = "~" + menu$(m, i)
i = i + 1
menu$(m, i) = "Sho#w separator": IF ShowLineNumbersSeparator THEN menu$(m, i) = CHR$(7) + menu$(m, i)
ViewMenuShowSeparatorID = i
IF ShowLineNumbers = 0 THEN menu$(m, i) = "~" + menu$(m, i)
i = i + 1
menusize(m) = i - 1
IF os$ = "WIN" THEN
idepathsep$ = "\"
END IF
@ -725,6 +742,7 @@ FUNCTION ide2 (ignore)
'main loop
DO
ideloop:
IF ShowLineNumbers THEN maxLineNumberLength = LEN(STR$(iden)) + 1 ELSE maxLineNumberLength = 0
idecontextualmenu = 0
idedeltxt 'removes temporary strings (typically created by guibox commands) by setting an index to 0
IF idesubwindow <> 0 THEN _RESIZE OFF ELSE _RESIZE ON
@ -1402,7 +1420,7 @@ FUNCTION ide2 (ignore)
GOTO specialchar
END IF
'3- Link to the output folder when "Save EXE in the source folder" is checked:
'3- Link to the output folder when "Output EXE to source #folder" is checked:
IF INSTR(_OS$, "WIN") THEN
SHELL _DONTWAIT "explorer /select," + QuotedFilename$(path.exe$ + file$ + extension$)
ELSEIF INSTR(_OS$, "MAC") THEN
@ -2633,7 +2651,7 @@ FUNCTION ide2 (ignore)
ideselecty1 = wholeword.selecty1
idecy = wholeword.idecy
END IF
newposition = mX - 1 + idesx - 1
newposition = (mX - 1 + idesx - 1) - maxLineNumberLength
a$ = idegetline$(idecy)
IF newposition > LEN(a$) THEN idecx = newposition: GOTO DoneWholeWord
IF newposition = 1 THEN ideselectx1 = 1: GOTO DoneWholeWord
@ -2659,11 +2677,11 @@ FUNCTION ide2 (ignore)
END IF
IF mCLICK THEN
IF mX > 1 AND mX < idewx AND mY > 2 AND mY < (idewy - 5) THEN 'inside text box
IF mX > 1 + maxLineNumberLength AND mX < idewx AND mY > 2 AND mY < (idewy - 5) THEN 'inside text box
IF old.mX = mX AND old.mY = mY THEN
IF TIMER - last.TBclick# > .5 THEN GOTO regularTextBox_click
'Double-click on text box: attempt to select "word" clicked
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN
GOTO regularTextBox_click
@ -2754,13 +2772,33 @@ FUNCTION ide2 (ignore)
regularTextBox_click:
old.mX = mX: old.mY = mY: last.TBclick# = TIMER
ideselect = 1
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
ideselect = 1: ideselectx1 = idecx: ideselecty1 = idecy
ideselect = 1
IF (NOT KSHIFT) THEN ideselectx1 = idecx: ideselecty1 = idecy
idemouseselect = 1
wholeword.select = 0
END IF
ELSEIF mX > 1 AND mx =< 1 + maxLineNumberLength AND mY > 2 AND mY < (idewy - 5) AND ShowLineNumbers THEN
'line numbers are visible and been clicked
ideselect = 1
idecy = mY - 2 + idesy - 1
IF idecy < iden THEN
IF (NOT KSHIFT) THEN ideselectx1 = 1: ideselecty1 = idecy
idecy = idecy + 1
idecx = 1
ELSEIF idecy = iden THEN
a$ = idegetline$(idecy)
IF (NOT KSHIFT) THEN ideselectx1 = 1: ideselecty1 = idecy
idecx = LEN(a$) + 1
ELSEIF idecy > iden THEN
idecy = iden
ideselect = 0
idecx = 1
END IF
wholeword.select = 0
idemouseselect = 0
END IF
END IF
@ -2768,9 +2806,9 @@ FUNCTION ide2 (ignore)
IF mCLICK2 THEN 'Second mouse button pressed.
invokecontextualmenu:
IF mX > 1 AND mX < idewx AND mY > 2 AND mY < (idewy - 5) THEN 'inside text box
IF mX > 1 + maxLineNumberLength AND mX < idewx AND mY > 2 AND mY < (idewy - 5) THEN 'inside text box
IF ideselect = 0 THEN 'Right click only positions the cursor if no selection is active
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
ELSE 'A selection is reported but it may be that the user only clicked the screen. Let's check:
@ -2785,14 +2823,14 @@ FUNCTION ide2 (ignore)
IF a2$ = "" THEN
'Told ya.
ideselect = 0
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
ELSE
'Ok, there is a selection. But we'll override it if the click was outside it
IF mX - 1 + idesx - 1 < sx1 OR mX - 1 + idesx - 1 > sx2 THEN
IF (mX - 1 + idesx - 1) - maxLineNumberLength < sx1 OR (mX - 1 + idesx - 1) - maxLineNumberLength > sx2 THEN
ideselect = 0
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
ideshowtext
@ -2800,7 +2838,7 @@ FUNCTION ide2 (ignore)
END IF
IF mY - 2 + idesy - 1 < idecy OR mY - 2 + idesy - 1 > idecy THEN
ideselect = 0
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
ideshowtext
@ -2814,7 +2852,7 @@ FUNCTION ide2 (ignore)
IF sy1 > sy2 THEN SWAP sy1, sy2
IF mY - 2 + idesy - 1 < sy1 OR mY - 2 + idesy - 1 > sy2 THEN
ideselect = 0
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
ideshowtext
@ -2924,9 +2962,10 @@ FUNCTION ide2 (ignore)
END IF
IF mB AND idemouseselect <= 1 THEN
IF mX > 1 AND mX < idewx AND mY > 2 AND mY < idewy - 5 THEN 'inside text box
IF mX > 1 + maxLineNumberLength AND mX < idewx AND mY > 2 AND mY < idewy - 5 THEN 'inside text box
IF idemouseselect = 1 THEN
idecx = mX - 1 + idesx - 1
idecx = (mX - 1 + idesx - 1) - maxLineNumberLength
IF idecx < 1 THEN idecx = 1
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN idecy = iden
END IF
@ -2934,13 +2973,13 @@ FUNCTION ide2 (ignore)
END IF
IF mB THEN
IF mX = 1 OR mX = idewx OR mY <= 2 OR mY >= idewy - 5 THEN 'off text window area
IF ((mX = 1 AND ShowLineNumbers = 0) OR (mX <= 1 + maxLineNumberLength AND ShowLineNumbers)) OR mX = idewx OR mY <= 2 OR mY >= idewy - 5 THEN 'off text window area
IF idemouseselect = 1 THEN
'scroll window
IF mY >= idewy - 5 THEN idecy = idecy + 1: IF idecy > iden THEN idecy = iden
IF mY <= 2 THEN idecy = idecy - 1: IF idecy < 1 THEN idecy = 1
IF mX = 1 THEN idecx = idecx - 1: IF idecx < 1 THEN idecx = 1
IF ((mX = 1 AND ShowLineNumbers = 0) OR (mX <= 1 + maxLineNumberLength AND ShowLineNumbers)) THEN idecx = idecx - 1: IF idecx < 1 THEN idecx = 1
IF mX = idewx THEN idecx = idecx + 1
idewait
END IF
@ -3940,7 +3979,7 @@ FUNCTION ide2 (ignore)
GetInput
IF oldmx <> mX OR oldmy <> mY THEN
IF mY = 1 AND idecontextualmenu = 0 THEN 'Check if we're hovering on menu bar
IF mY = 1 AND idecontextualmenu <> 1 THEN 'Check if we're hovering on menu bar
lastm = m
FOR i = 1 TO menus
x = CVI(MID$(MenuLocations, i * 2 - 1, 2))
@ -4053,8 +4092,13 @@ FUNCTION ide2 (ignore)
IF IdeSystem = 2 THEN IdeSystem = 1: GOSUB UpdateSearchBar
PCOPY 0, 2
SCREEN , , 1, 0
updateMenuPanel%% = 0
parentMenuR = r
r = 1
parentMenu = 0
parentMenuSetup%% = 0
IF idecontextualmenu = 1 THEN idectxmenuX = mX: idectxmenuY = mY: m = idecontextualmenuID
IF idecontextualmenu = 2 THEN idectxmenuX = xx + w + 3: idectxmenuY = yy + r: parentMenu = m: m = ViewMenuShowLineNumbersSubMenuID
IdeMakeEditMenu
oldmy = mY: oldmx = mX
DO
@ -4066,6 +4110,14 @@ FUNCTION ide2 (ignore)
IF i = menus - 1 THEN x = idewx - LEN(menu$(menus, 0)) - 1
NEXT: xx = x
LOCATE 1, xx - 1: COLOR 7, 0: PRINT " " + menu$(m, 0) + " "
ELSE
IF parentMenu > 0 AND parentMenuSetup%% = 0 THEN
parentMenuSetup%% = -1
backToParent.x1 = xx - 1
backToParent.x2 = xx + w
backToParent.y1 = 3
backToParent.y2 = backToParent.y1 + menusize(parentMenu)
END IF
END IF
COLOR 0, 7
'calculate menu width
@ -4080,7 +4132,7 @@ FUNCTION ide2 (ignore)
IF l > w THEN w = l
NEXT
yy = 2
IF idecontextualmenu = 1 THEN
IF idecontextualmenu > 0 THEN
actual.idewy = idewy
IF idesubwindow <> 0 THEN
actual.idewy = idewy + idesubwindow
@ -4102,7 +4154,7 @@ FUNCTION ide2 (ignore)
ELSEIF LEFT$(m$, 1) = "~" THEN
m$ = RIGHT$(m$, LEN(m$) - 1) 'Remove the tilde before printing
IF r = i THEN LOCATE i + yy, xx - 1: COLOR 7, 0: PRINT SPACE$(w + 2);
LOCATE i + yy, xx
IF LEFT$(m$, 1) = CHR$(7) THEN LOCATE i + yy, xx - 1 ELSE LOCATE i + yy, xx
h = -1: x = INSTR(m$, "#"): IF x THEN h = x: m$ = LEFT$(m$, x - 1) + RIGHT$(m$, LEN(m$) - x)
x = INSTR(m$, " "): IF x THEN m1$ = LEFT$(m$, x - 1): m2$ = RIGHT$(m$, LEN(m$) - x - 1): m$ = m1$ + SPACE$(w - LEN(m1$) - LEN(m2$)) + m2$
FOR x = 1 TO LEN(m$)
@ -4122,15 +4174,13 @@ FUNCTION ide2 (ignore)
END IF
PRINT MID$(m$, x, 1);
NEXT
END IF
NEXT
PCOPY 1, 0
IF updateMenuPanel%% THEN GOTO menuChoiceMade
change = 0
DO
mousedown = 0: mouseup = 0
@ -4183,7 +4233,7 @@ FUNCTION ide2 (ignore)
GOTO ideloop
END IF
IF mCLICK2 AND idecontextualmenu THEN 'A new right click in the text area repositions the contextual menu
IF mCLICK2 AND idecontextualmenu = 1 THEN 'A new right click in the text area repositions the contextual menu
IF mX > 1 AND mX < idewx AND mY > 2 AND mY < (idewy - 5) THEN
PCOPY 3, 0: SCREEN , , 3, 0
GOTO invokecontextualmenu
@ -4204,12 +4254,33 @@ FUNCTION ide2 (ignore)
END IF
END IF
IF mX < xx - 2 OR mX >= xx - 2 + w + 4 OR mY > yy + menusize(m) + 1 OR (mY < yy AND idecontextualmenu) THEN
IF parentMenu > 0 AND _
mX >= backToParent.x1 AND mX =< backToParent.x2 AND _
mY >= backToParent.y1 AND mY =< backToParent.y2 THEN
m = parentMenu
r = parentMenuR
parentMenu = 0
idecontextualmenu = 0
PCOPY 3, 2
_CONTINUE
END IF
IF mX < xx - 2 OR mX >= xx - 2 + w + 4 OR mY > yy + menusize(m) + 1 OR (mY < yy AND idecontextualmenu = 1) THEN
PCOPY 3, 0: SCREEN , , 3, 0
GOTO ideloop
END IF
END IF
IF NOT mouseup AND NOT mousedown THEN 'Check if we're hovering on menu options
IF parentMenu > 0 AND oldmy <> mY AND oldmx <> mX AND _
mX >= backToParent.x1 AND mX =< backToParent.x2 AND _
mY >= backToParent.y1 AND mY =< backToParent.y2 THEN
m = parentMenu
r = parentMenuR
parentMenu = 0
idecontextualmenu = 0
PCOPY 3, 2
_CONTINUE
END IF
IF oldmy <> mY THEN
IF mX >= xx - 2 AND mX < xx - 2 + w + 4 THEN
IF mY > yy AND mY <= menusize(m) + yy THEN
@ -4225,7 +4296,7 @@ FUNCTION ide2 (ignore)
END IF
IF oldmx <> mX THEN
checkmenubarhover:
IF mY = 1 AND idecontextualmenu = 0 THEN 'Check if we're hovering on menu bar
IF mY = 1 AND idecontextualmenu <> 1 THEN 'Check if we're hovering on menu bar
lastm = m
FOR i = 1 TO menus
x = CVI(MID$(MenuLocations, i * 2 - 1, 2))
@ -4233,6 +4304,7 @@ FUNCTION ide2 (ignore)
IF mX >= x AND mX < x2 THEN
m = i
r = 1
IF idecontextualmenu > 1 THEN idecontextualmenu = 0: PCOPY 3, 2
EXIT FOR
END IF
NEXT
@ -4245,7 +4317,6 @@ FUNCTION ide2 (ignore)
'top row
IF mY = 1 THEN
idecontextualmenu = 0
lastm = m
x = 3
FOR i = 1 TO menus
@ -4254,6 +4325,7 @@ FUNCTION ide2 (ignore)
m = i
r = 1
IF lastm = m AND mousedown = 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: GOTO ideloop
idecontextualmenu = 0
EXIT FOR
END IF
x = x + x2
@ -4271,8 +4343,31 @@ FUNCTION ide2 (ignore)
END IF 'mb
IF KB = KEY_LEFT AND idecontextualmenu = 0 THEN m = m - 1: r = 1
IF KB = KEY_RIGHT AND idecontextualmenu = 0 THEN m = m + 1: r = 1
IF KB = KEY_LEFT AND idecontextualmenu = 0 THEN
m = m - 1: r = 1
ELSEIF KB = KEY_LEFT AND idecontextualmenu > 1 THEN
idecontextualmenu = 0
PCOPY 3, 2
m = parentMenu
r = parentMenuR
parentMenu = 0
END IF
IF KB = KEY_RIGHT AND idecontextualmenu = 0 THEN
IF RIGHT$(menu$(m, r), 1) = CHR$(16) THEN
SELECT CASE LEFT$(menu$(m, r), LEN(menu$(m, r)) - 3)
CASE "#Line numbers"
idecontextualmenu = 2
GOTO showmenu
END SELECT
ELSE
m = m + 1: r = 1
END IF
ELSEIF KB = KEY_RIGHT AND idecontextualmenu > 1 THEN
idecontextualmenu = 0
PCOPY 3, 2
m = parentMenu + 1
r = 1
END IF
IF m < 1 THEN m = menus
IF m > menus AND idecontextualmenu = 0 THEN m = 1
IF KB = KEY_ESC THEN
@ -4305,13 +4400,14 @@ FUNCTION ide2 (ignore)
x = INSTR(menu$(m, r2), "#")
IF x THEN
a$ = UCASE$(MID$(menu$(m, r2), x + 1, 1))
IF K$ = a$ THEN s = r2: EXIT FOR
IF K$ = a$ THEN s = r2: updateMenuPanel%% = -1: EXIT FOR
END IF
NEXT
IF updateMenuPanel%% THEN r = r2: _CONTINUE
END IF
IF s THEN
menuChoiceMade:
IF KALT THEN idehl = 1 ELSE idehl = 0 'set idehl, a shared variable used by various dialogue boxes
IF menu$(m, s) = "Comment (add ') Ctrl+R" THEN
@ -4384,11 +4480,6 @@ FUNCTION ide2 (ignore)
GOTO ideloop
END IF
IF LEFT$(menu$(m, s), 16) = "~Decrease indent" OR menu$(m, s) = "~Increase indent TAB" THEN
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
END IF
IF menu$(m, s) = "#Language..." THEN
PCOPY 2, 0
retval = idelanguagebox
@ -4495,15 +4586,15 @@ FUNCTION ide2 (ignore)
GOTO ideloop
END IF
IF RIGHT$(menu$(m, s), 30) = "Save EXE in the source #folder" THEN
IF RIGHT$(menu$(m, s), 28) = "Output EXE to source #folder" THEN
PCOPY 2, 0
SaveExeWithSource = NOT SaveExeWithSource
IF SaveExeWithSource THEN
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "TRUE"
menu$(RunMenuID, RunMenuSaveExeWithSource) = CHR$(7) + "Save EXE in the source #folder"
menu$(RunMenuID, RunMenuSaveExeWithSource) = CHR$(7) + "Output EXE to source #folder"
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "FALSE"
menu$(RunMenuID, RunMenuSaveExeWithSource) = "Save EXE in the source #folder"
menu$(RunMenuID, RunMenuSaveExeWithSource) = "Output EXE to source #folder"
END IF
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
@ -4812,6 +4903,65 @@ FUNCTION ide2 (ignore)
GOTO ideloop
END IF
IF menu$(m, s) = "#Line numbers " + CHR$(16) THEN
idecontextualmenu = 2
GOTO showmenu
END IF
IF menu$(m, s) = "#Show line numbers" THEN
PCOPY 2, 0
ShowLineNumbers = -1
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbers", "TRUE"
menu$(m, s) = "#Hide line numbers"
menu$(m, ViewMenuShowBGID) = MID$(menu$(m, ViewMenuShowBGID), 2)
menu$(m, ViewMenuShowSeparatorID) = MID$(menu$(m, ViewMenuShowSeparatorID), 2)
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
END IF
IF menu$(m, s) = "#Hide line numbers" THEN
PCOPY 2, 0
ShowLineNumbers = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbers", "FALSE"
menu$(m, s) = "#Show line numbers"
menu$(m, ViewMenuShowBGID) = "~" + menu$(m, ViewMenuShowBGID)
menu$(m, ViewMenuShowSeparatorID) = "~" + menu$(m, ViewMenuShowSeparatorID)
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
END IF
IF RIGHT$(menu$(m, s), 17) = "#Background color" THEN
IF LEFT$(menu$(m, s), 1) <> "~" THEN
PCOPY 2, 0
ShowLineNumbersUseBG = NOT ShowLineNumbersUseBG
IF ShowLineNumbersUseBG THEN
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersUseBG", "TRUE"
menu$(m, s) = CHR$(7) + "#Background color"
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersUseBG", "FALSE"
menu$(m, s) = "#Background color"
END IF
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
END IF
END IF
IF RIGHT$(menu$(m, s), 15) = "Sho#w separator" THEN
IF LEFT$(menu$(m, s), 1) <> "~" THEN
PCOPY 2, 0
ShowLineNumbersSeparator = NOT ShowLineNumbersSeparator
IF ShowLineNumbersSeparator THEN
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersSeparator", "TRUE"
menu$(m, s) = CHR$(7) + "Sho#w separator"
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "ShowLineNumbersSeparator", "FALSE"
menu$(m, s) = "Sho#w separator"
END IF
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
END IF
END IF
IF menu$(m, s) = "#Find... Ctrl+F3" THEN
PCOPY 2, 0
idefindjmp:
@ -5255,10 +5405,9 @@ FUNCTION ide2 (ignore)
END IF
IF LEFT$(menu$(m, s), 1) = "~" THEN 'Ignore disabled items (starting with "~")
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt: GOTO ideloop
_CONTINUE
END IF
SCREEN , , 0, 0
CLS: PRINT "MENU ITEM [" + menu$(m, s) + "] NOT IMPLEMENTED!": END
END IF
@ -8148,7 +8297,7 @@ SUB ideshowtext
IF idecx < idesx THEN idesx = idecx
IF idecy < idesy THEN idesy = idecy
IF idecx - idesx >= (idewx - 2) THEN idesx = idecx - (idewx - 3)
IF (idecx + maxLineNumberLength) - idesx >= (idewx - 2) THEN idesx = (idecx + maxLineNumberLength) - (idewx - 3)
IF idecy - idesy >= (idewy - 8) THEN idesy = idecy - (idewy - 9)
sy1 = ideselecty1
@ -8205,6 +8354,21 @@ SUB ideshowtext
LOCATE y + 3, 1
COLOR 7, 1
PRINT CHR$(179); 'clear prev bookmarks from lhs
IF ShowLineNumbers THEN
IF ShowLineNumbersUseBG THEN COLOR , 6
PRINT SPACE$(maxLineNumberLength);
IF l <= iden THEN
l2$ = STR$(l)
IF POS(1) - (LEN(l2$) + 1) >= 2 THEN
LOCATE y + 3, POS(1) - (LEN(l2$) + 1)
PRINT l2$;
END IF
END IF
IF ShowLineNumbersSeparator THEN LOCATE y + 3, 1 + maxLineNumberLength: PRINT CHR$(179);
COLOR , 1
END IF
IF l = idefocusline AND idecy <> l THEN
COLOR 7, 4 'Line with error gets a red background
ELSEIF idecy = l OR (l >= idecy_multilinestart AND l <= idecy_multilineend) THEN
@ -8218,7 +8382,7 @@ SUB ideshowtext
link_idecx = 0
rgb_idecx = 0
IF l = idecy THEN
IF idecx <= LEN(a$) THEN
IF idecx <= LEN(a$) AND idecx >= 1 THEN
cc = ASC(a$, idecx)
IF cc = 32 THEN
IF LTRIM$(LEFT$(a$, idecx)) = "" THEN cc = -1
@ -8339,7 +8503,6 @@ SUB ideshowtext
a2$ = SPACE$(idesx + (idewx - 3))
MID$(a2$, 1) = a$
'a2$ = RIGHT$(a2$, (idewx - 2))
ELSE
a2$ = SPACE$((idewx - 2))
END IF
@ -8525,9 +8688,16 @@ SUB ideshowtext
LOOP ' verifying the code and growing the array during the IDE passes.
IF InValidLine(l) AND 1 THEN COLOR 7
IF 2 + m - idesx >= 2 AND 2 + m - idesx < idewx THEN
LOCATE y + 3, 2 + m - idesx
PRINT thisChar$;
IF ShowLineNumbers THEN
IF (2 + m - idesx) + maxLineNumberLength >= 2 + maxLineNumberLength AND (2 + m - idesx) + maxLineNumberLength < idewx THEN
LOCATE y + 3, (2 + m - idesx) + maxLineNumberLength
PRINT thisChar$;
END IF
ELSE
IF 2 + m - idesx >= 2 AND 2 + m - idesx < idewx THEN
LOCATE y + 3, 2 + m - idesx
PRINT thisChar$;
END IF
END IF
'Restore BG color in case a matching bracket was printed with different BG
@ -8542,7 +8712,7 @@ SUB ideshowtext
IF sy1 = sy2 THEN 'single line select
COLOR 1, 7
x2 = idesx
FOR x = 2 TO (idewx - 2)
FOR x = 2 + maxLineNumberLength TO (idewx - 2)
IF x2 >= sx1 AND x2 < sx2 THEN
a = SCREEN(y + 3, x)
@ -8566,10 +8736,10 @@ SUB ideshowtext
COLOR 7, 1
ELSE 'multiline select
IF idecx = 1 AND l = sy2 AND idecy > sy1 THEN GOTO nofinalselect
LOCATE y + 3, 2
LOCATE y + 3, 2 + maxLineNumberLength
COLOR 1, 7
FOR x = idesx TO idesx + idewx - 2
FOR x = idesx TO idesx + idewx - (2 + maxLineNumberLength)
PRINT MID$(a2$, x, 1);
NEXT
@ -8606,7 +8776,7 @@ SUB ideshowtext
LOCATE idewy + idesubwindow, (idewx - 10) - LEN(a$)
PRINT a$;
SCREEN , , 0, 0: LOCATE idecy - idesy + 3, idecx - idesx + 2: SCREEN , , 3, 0
SCREEN , , 0, 0: LOCATE idecy - idesy + 3, maxLineNumberLength + idecx - idesx + 2: SCREEN , , 3, 0
EXIT SUB
FindQuoteComment:
@ -13552,7 +13722,7 @@ SUB IdeMakeContextualMenu
a$ = idegetline(idecy)
a2$ = ""
x = idecx
IF x <= LEN(a$) THEN
IF x <= LEN(a$) AND x >= 1 THEN
IF alphanumeric(ASC(a$, x)) THEN
x1 = x
DO WHILE x1 > 1