1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-30 05:10:37 +00:00

Adds item in Options menu to disable auto-complete.

Fixes IgnoreWarnings not being saved in macOS/Linux.
This commit is contained in:
Fellippe Heitor 2021-02-04 23:48:14 -03:00
parent 70ea149168
commit a6fe260a5e
3 changed files with 55 additions and 19 deletions

View file

@ -16,6 +16,7 @@ DIM SHARED ShowLineNumbersSeparator AS _BYTE, ShowLineNumbersUseBG AS _BYTE
DIM SHARED IgnoreWarnings AS _BYTE, qb64versionprinted AS _BYTE DIM SHARED IgnoreWarnings AS _BYTE, qb64versionprinted AS _BYTE
DIM SHARED DisableSyntaxHighlighter AS _BYTE, ExeToSourceFolderFirstTimeMsg AS _BYTE DIM SHARED DisableSyntaxHighlighter AS _BYTE, ExeToSourceFolderFirstTimeMsg AS _BYTE
DIM SHARED WhiteListQB64FirstTimeMsg AS _BYTE, ideautolayoutkwcapitals AS _BYTE DIM SHARED WhiteListQB64FirstTimeMsg AS _BYTE, ideautolayoutkwcapitals AS _BYTE
DIM SHARED IdeAutoComplete AS _BYTE
IF LoadedIDESettings = 0 THEN IF LoadedIDESettings = 0 THEN
'We only want to load the file once when QB64 first starts 'We only want to load the file once when QB64 first starts
@ -352,6 +353,32 @@ IF LoadedIDESettings = 0 THEN
multihighlight = -1 multihighlight = -1
END IF END IF
result = ReadConfigSetting("IgnoreWarnings", value$)
IF result THEN
IF UCASE$(value$) = "TRUE" OR ABS(VAL(value$)) = 1 THEN
IgnoreWarnings = -1
ELSE
IgnoreWarnings = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE"
END IF
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE"
IgnoreWarnings = 0
END IF
result = ReadConfigSetting("IdeAutoComplete", value$)
IF result THEN
IF UCASE$(value$) = "TRUE" OR ABS(VAL(value$)) = 1 THEN
IdeAutoComplete = -1
ELSE
IdeAutoComplete = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IdeAutoComplete", "FALSE"
END IF
ELSE
WriteConfigSetting "'[GENERAL SETTINGS]", "IdeAutoComplete", "TRUE"
IdeAutoComplete = -1
END IF
IF INSTR(_OS$, "WIN") THEN IF INSTR(_OS$, "WIN") THEN
result = ReadConfigSetting("IDE_AutoPosition", value$) result = ReadConfigSetting("IDE_AutoPosition", value$)
IF result THEN IF result THEN
@ -382,17 +409,6 @@ IF LoadedIDESettings = 0 THEN
IDE_LeftPosition = 0 IDE_LeftPosition = 0
END IF END IF
result = ReadConfigSetting("IgnoreWarnings", value$)
IF result THEN
IF UCASE$(value$) = "TRUE" OR ABS(VAL(value$)) = 1 THEN
IgnoreWarnings = -1
ELSE
IgnoreWarnings = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE"
END IF
END IF
'I was going to do some basic error checking for screen position to make certain that we appeared on the monitor, 'I was going to do some basic error checking for screen position to make certain that we appeared on the monitor,
'but I decided not to. Some people (like me) may have multiple monitors set up and may wish for QB64 to pop-up at 'but I decided not to. Some people (like me) may have multiple monitors set up and may wish for QB64 to pop-up at
'a coordinate which seems insane at first glance (-1000,0 for instance), but which may move the IDE window to the 'a coordinate which seems insane at first glance (-1000,0 for instance), but which may move the IDE window to the

View file

@ -199,7 +199,7 @@ DIM SHARED menus AS INTEGER, idecontextualmenuID AS INTEGER
DIM SHARED ideeditmenuID AS INTEGER, SearchMenuID AS INTEGER DIM SHARED ideeditmenuID AS INTEGER, SearchMenuID AS INTEGER
DIM SHARED OptionsMenuID AS INTEGER, OptionsMenuSwapMouse AS INTEGER, OptionsMenuPasteCursor AS INTEGER DIM SHARED OptionsMenuID AS INTEGER, OptionsMenuSwapMouse AS INTEGER, OptionsMenuPasteCursor AS INTEGER
DIM SHARED OptionsMenuShowErrorsImmediately AS INTEGER, OptionsMenuIgnoreWarnings AS INTEGER DIM SHARED OptionsMenuShowErrorsImmediately AS INTEGER, OptionsMenuIgnoreWarnings AS INTEGER
DIM SHARED OptionsMenuDisableSyntax AS INTEGER DIM SHARED OptionsMenuDisableSyntax AS INTEGER, OptionsMenuAutoComplete
DIM SHARED ViewMenuID AS INTEGER, ViewMenuShowLineNumbersSubMenuID AS INTEGER DIM SHARED ViewMenuID AS INTEGER, ViewMenuShowLineNumbersSubMenuID AS INTEGER
DIM SHARED ViewMenuShowSeparatorID AS INTEGER, ViewMenuShowBGID AS INTEGER DIM SHARED ViewMenuShowSeparatorID AS INTEGER, ViewMenuShowBGID AS INTEGER
DIM SHARED ViewMenuCompilerWarnings AS INTEGER DIM SHARED ViewMenuCompilerWarnings AS INTEGER

View file

@ -351,6 +351,11 @@ FUNCTION ide2 (ignore)
menu$(m, i) = "Ignore #Warnings": i = i + 1 menu$(m, i) = "Ignore #Warnings": i = i + 1
IF IgnoreWarnings THEN menu$(OptionsMenuID, OptionsMenuIgnoreWarnings) = CHR$(7) + "Ignore #Warnings" IF IgnoreWarnings THEN menu$(OptionsMenuID, OptionsMenuIgnoreWarnings) = CHR$(7) + "Ignore #Warnings"
OptionsMenuAutoComplete = i
menu$(m, i) = "Code Suggest#ions": i = i + 1
IF IdeAutoComplete THEN menu$(OptionsMenuID, OptionsMenuAutoComplete) = CHR$(7) + "Code Suggest#ions"
menusize(m) = i - 1 menusize(m) = i - 1
m = m + 1: i = 0 m = m + 1: i = 0
@ -3549,8 +3554,7 @@ FUNCTION ide2 (ignore)
HideBracketHighlight HideBracketHighlight
keywordHighlight = oldkeywordHighlight keywordHighlight = oldkeywordHighlight
retval$ = idergbmixer$(0) retval$ = idergbmixer$(0)
ELSEIF idefocusline > 0 AND LEN(_TRIM$(a$)) = 0 THEN ELSEIF IdeAutoComplete AND idefocusline > 0 AND LEN(_TRIM$(a$)) = 0 THEN
'close open block 'close open block
IF idefocusline = definingtypeerror THEN IF idefocusline = definingtypeerror THEN
insertAtCursor SCase$("End Type"): GOTO specialchar insertAtCursor SCase$("End Type"): GOTO specialchar
@ -4720,12 +4724,12 @@ FUNCTION ide2 (ignore)
IF RIGHT$(menu$(m, s), 16) = "Ignore #Warnings" THEN IF RIGHT$(menu$(m, s), 16) = "Ignore #Warnings" THEN
PCOPY 2, 0 PCOPY 2, 0
IF Ignorewarnings = 0 THEN IF IgnoreWarnings = 0 THEN
Ignorewarnings = -1 IgnoreWarnings = -1
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "TRUE" WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "TRUE"
menu$(OptionsMenuID, OptionsMenuIgnoreWarnings) = CHR$(7) + "Ignore #Warnings" menu$(OptionsMenuID, OptionsMenuIgnoreWarnings) = CHR$(7) + "Ignore #Warnings"
ELSE ELSE
Ignorewarnings = 0 IgnoreWarnings = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE" WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE"
menu$(OptionsMenuID, OptionsMenuIgnoreWarnings) = "Ignore #Warnings" menu$(OptionsMenuID, OptionsMenuIgnoreWarnings) = "Ignore #Warnings"
END IF END IF
@ -4734,6 +4738,22 @@ FUNCTION ide2 (ignore)
GOTO ideloop GOTO ideloop
END IF END IF
IF RIGHT$(menu$(m, s), 17) = "Code Suggest#ions" THEN
PCOPY 2, 0
IF IdeAutoComplete = 0 THEN
IdeAutoComplete = -1
WriteConfigSetting "'[GENERAL SETTINGS]", "IdeAutoComplete", "TRUE"
menu$(OptionsMenuID, OptionsMenuAutoComplete) = CHR$(7) + "Code Suggest#ions"
ELSE
IdeAutoComplete = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IdeAutoComplete", "FALSE"
menu$(OptionsMenuID, OptionsMenuAutoComplete) = "Code Suggest#ions"
END IF
idechangemade = 1
PCOPY 3, 0: SCREEN , , 3, 0
GOTO ideloop
END IF
IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN
PCOPY 2, 0 PCOPY 2, 0
SaveExeWithSource = NOT SaveExeWithSource SaveExeWithSource = NOT SaveExeWithSource
@ -8163,7 +8183,7 @@ SUB ideshowtext
'an _RGB(, _RGB32(, _RGBA( or _RGBA32(, we'll offer the RGB 'an _RGB(, _RGB32(, _RGBA( or _RGBA32(, we'll offer the RGB
'color mixer. 'color mixer.
a2$ = UCASE$(a$) a2$ = UCASE$(a$)
IF idecx = LEN(a$) + 1 AND idecx_comment + idecx_quote = 0 THEN IF IdeAutoComplete AND idecx = LEN(a$) + 1 AND idecx_comment + idecx_quote = 0 THEN
IF (RIGHT$(a2$, 5) = "_RGB(" OR _ IF (RIGHT$(a2$, 5) = "_RGB(" OR _
RIGHT$(a2$, 7) = "_RGB32(" OR _ RIGHT$(a2$, 7) = "_RGB32(" OR _
RIGHT$(a2$, 6) = "_RGBA(" OR _ RIGHT$(a2$, 6) = "_RGBA(" OR _
@ -8201,7 +8221,7 @@ SUB ideshowtext
END IF END IF
ELSE ELSE
temp_a$ = idegetline(idecy) temp_a$ = idegetline(idecy)
IF idefocusline = l AND LEN(_TRIM$(temp_a$)) = 0 THEN IF IdeAutoComplete AND idefocusline = l AND LEN(_TRIM$(temp_a$)) = 0 THEN
'some errors are mere blocks the user just opened and is still 'some errors are mere blocks the user just opened and is still
'working on. This bit will offer to close said blocks. 'working on. This bit will offer to close said blocks.
IF idefocusline = definingtypeerror THEN IF idefocusline = definingtypeerror THEN