Skip to content

Add optional save-time editor behaviours - #387

Open
Richard70NL wants to merge 6 commits into
fantaisie-software:develfrom
Richard70NL:feature/save-time-editor-behaviours
Open

Add optional save-time editor behaviours#387
Richard70NL wants to merge 6 commits into
fantaisie-software:develfrom
Richard70NL:feature/save-time-editor-behaviours

Conversation

@Richard70NL

Copy link
Copy Markdown

Summary

Adds three independent, default-off options under Preferences > Editor > On Save:

  • Remove trailing whitespace removes spaces and tabs from the end of source lines.
  • Normalize end of source file normalises a non-empty source to exactly one final newline, preserving its selected newline format.
  • Format indentation applies the IDE's existing full-source indentation operation to recognised code files before saving.

Formatting runs before whitespace clean-up. All enabled operations share one undo action and avoid no-op edits.

Save As uses the target extension to decide whether indentation formatting applies.

Preferences and documentation

  • Preferences are persisted independently and default to disabled.
  • The built-in English language table and canonical English preference help include the new UI and behaviour descriptions.
  • External catalogues and translated help remain under the existing translation workflow.
  • The Windows preference screenshot was not updated from the macOS development environment.

Verification

  • Built the IDE successfully with PureBasic 6.40 on macOS arm64 using the repository makefile and a separate development installation.
  • Manually verified:
    • each option disabled and enabled,
    • combined operation order,
    • one-step undo,
    • repeated no-op saves,
    • preference persistence,
    • empty and whitespace-only sources,
    • newline preservation,
    • non-ASCII content, and
    • Save As classification for code and plain-text extensions.
  • git diff --check upstream/devel...HEAD passes.

Limitations

  • Windows and Linux builds have not been tested.
  • validate.sh stops on four pre-existing tracked files containing embedded IDE settings before reaching its ECLint check. This pull request does not change those files.

Development process

This is my first contribution to the PureBasic repository. I am an experienced BASIC programmer, primarily with Visual Basic, VBA and VBScript in corporate environments since the mid-1990s.

I used OpenAI Codex as a pair-programming assistant during repository investigation, implementation, review and documentation. I reviewed the resulting changes and performed the manual verification described above. I remain responsible for the submitted code and documentation.

@Richard70NL
Richard70NL force-pushed the feature/save-time-editor-behaviours branch from f11e35e to 863c522 Compare August 12, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant