Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export enhancement #536

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions source/ide/ide_methods.bas
Original file line number Diff line number Diff line change
Expand Up @@ -20668,21 +20668,23 @@ SUB ExportCodeAs (docFormat$)
IF INSTR(_OS$, "[LINUX]") = 0 THEN cEol$ = CHR$(13) + cEol$
'------------------------------
PCOPY 3, 2: SCREEN , , 3, 0
sTxt$ = "" ' '=> source code text
FOR i& = 1 TO iden
sTxt$ = sTxt$ + idegetline(i&) + cEol$
perc$ = str2$(INT(30 / iden * i&))
IdeInfo = CHR$(0) + STRING$(3 - LEN(perc$), 32) + perc$ + "% exported..."
UpdateIdeInfo
NEXT i&
WHILE RIGHT$(sTxt$, LEN(cEol$)) = cEol$ 'normalize line feeds at EOF
sTxt$ = LEFT$(sTxt$, LEN(sTxt$) - LEN(cEol$))
WEND
sTxt$ = getSelectedText$(-1) '=> source code text (current selection)
IF sTxt$ = "" THEN
FOR i& = 1 TO iden ' '=> get full source, if no selection was made
sTxt$ = sTxt$ + idegetline(i&) + cEol$
perc$ = str2$(INT(30 / iden * i&))
IdeInfo = CHR$(0) + STRING$(3 - LEN(perc$), 32) + perc$ + "% exported..."
UpdateIdeInfo
NEXT i&
WHILE RIGHT$(sTxt$, LEN(cEol$)) = cEol$ 'normalize line feeds at EOF
sTxt$ = LEFT$(sTxt$, LEN(sTxt$) - LEN(cEol$))
WEND
END IF
IF sTxt$ = "" THEN sTxt$ = sTxt$ + cEol$: ELSE sTxt$ = sTxt$ + cEol$ + cEol$
sLen& = LEN(sTxt$) ' '=> source code length
sPos& = 1 ' '=> source code read position
eTxt$ = SPACE$(1000000) '=> export text buffer
ePos& = 1 ' '=> export text buffer write position
sLen& = LEN(sTxt$) ' '=> source code length
sPos& = 1 ' '=> source code read position
eTxt$ = SPACE$(1000000) ' '=> export text buffer
ePos& = 1 ' '=> export text buffer write position
'----------
post% = 0 ''=> GOSUB argument = 0/-1 (close pre current / post current char)
what$ = "" '=> GOSUB argument = command descriptor
Expand Down