Skip to content

feat(editor): togglable visual line break marker via show spaces option#2133

Open
Elitex07 wants to merge 24 commits into
Acode-Foundation:mainfrom
Elitex07:feature/line-break-marker
Open

feat(editor): togglable visual line break marker via show spaces option#2133
Elitex07 wants to merge 24 commits into
Acode-Foundation:mainfrom
Elitex07:feature/line-break-marker

Conversation

@Elitex07
Copy link
Copy Markdown

This pull request introduces a new feature that allows users to display visual markers for line breaks in the editor when text wrapping is enabled. It also includes updates to the development container configuration and Gradle build toolchain settings. The most significant changes are grouped below:

Editor Feature: Line Break Marker

  • Added a new CodeMirror plugin (lineBreakMarker) in src/cm/lineBreakMarker.ts that visually marks line breaks with a "¬" character.
  • Integrated the line break marker feature into the editor manager (src/lib/editorManager.js), including compartment management, settings application, and event handling for toggling the marker. [1] [2] [3] [4]
  • Added a new setting showLineBreakMarker to the default editor settings and the editor settings UI, allowing users to enable or disable the feature. [1] [2]
  • Updated the English language strings to include the new setting label.

Development Environment and Build Tooling

  • Added .devcontainer/devcontainer-lock.json to lock Node.js and Android SDK versions for the development container.
  • Added gradle/gradle-daemon-jvm.properties and updated settings.gradle to configure Gradle toolchains using the Foojay resolver convention plugin. [1] [2]
  • Added local.properties for local Android SDK configuration (note: this file should not be version controlled).

@github-actions github-actions Bot added enhancement New feature or request translations Anything related to Translations Whether a Issue or PR labels May 25, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR adds a visual line-break marker (¬) to the CodeMirror editor that appears at the end of each non-final line when both "show spaces" and "text wrap" are enabled, implemented as a new ViewPlugin in src/cm/lineBreakMarker.ts. It also bundles several unrelated housekeeping changes: devcontainer feature locking, Gradle JVM toolchain configuration, TypeScript type improvements in the AdMob plugin, and a new cordova-custom.d.ts declaration file.

  • Line break marker plugin (src/cm/lineBreakMarker.ts): correctly builds decorations only for visible ranges, uses lastLineNumber to avoid duplicate markers across range boundaries, and skips the final document line (which has no trailing newline). The plugin is wired into editorManager.js via a dedicated lineBreakMarkerCompartment that reacts to both showSpaces and textWrap setting changes.
  • Language string update: settings-info-editor-show-spaces was broadened to mention line break markers, but the description does not convey the textWrap dependency — users who enable showSpaces without textWrap will not see line break markers despite what the description implies.
  • .gitignore additions: necessary entries (.gradle/, local.properties) are mixed with personal developer-tool files (CLAUDE.md, graphify-out/, .graphify_python) that belong in a global gitignore rather than the shared project file.

Confidence Score: 5/5

The change is safe to merge; the new plugin is well-scoped, reactivity wiring in editorManager is correct, and there are no data-loss or security concerns.

The core feature — the CodeMirror ViewPlugin and its compartment integration — is implemented correctly: visible-range iteration is bounded, duplicate markers are prevented via lastLineNumber, and the last document line is correctly excluded. Setting reactivity responds to both showSpaces and textWrap changes as expected. The remaining findings are documentation wording and gitignore hygiene that do not affect runtime behavior.

src/lang/en-us.json and src/lang/hu-hu.json — the updated showSpaces description should mention the textWrap dependency to avoid user confusion.

Important Files Changed

Filename Overview
src/cm/lineBreakMarker.ts New CodeMirror plugin that appends a "¬" widget after each non-last line; logic is correct and visible-range iteration, deduplication, and last-line exclusion are all handled properly.
src/lib/editorManager.js Adds lineBreakMarkerCompartment and wires reactivity correctly via applyOptions on both showSpaces and textWrap keys; marker visibility is gated on showSpaces && textWrap.
src/lang/en-us.json Updates settings-info-editor-show-spaces description to mention line break markers, but omits the conditional dependency on textWrap being enabled.
.gitignore Adds several new ignores including .gradle/, local.properties, and personal dev-tool files (CLAUDE.md, graphify-out/, .graphify_python) to the project-level gitignore.
src/plugins/admob/src/www/ads/webview.ts Minor TypeScript annotation improvements: adds node: any types and tightens parameters to Record<string, any>.
src/plugins/admob/src/www/ads/index.ts Splits export { MobileAdOptions } into export type { MobileAdOptions } for correct type-only export handling under isolatedModules.
src/cordova-custom.d.ts New type declaration file that stubs cordova/channel and cordova/exec modules and augments the Cordova interface with fireDocumentEvent.
.devcontainer/devcontainer-lock.json Locks devcontainer Node.js and Android SDK feature versions via SHA digests for reproducible dev environments.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User toggles showSpaces or textWrap] --> B[applyOptions fires]
    B --> C{lineBreakMarkerCompartment build}
    C -->|showSpaces AND textWrap true| D[lineBreakMarker enabled]
    C -->|otherwise| E[empty extension - marker hidden]
    D --> F[ViewPlugin getDecorations]
    F --> G[Iterate visibleRanges]
    G --> H{line.number less than doc.lines?}
    H -->|Yes| I[Add marker widget at line.to]
    H -->|No - last line| J[Skip]
    I --> K[RangeSetBuilder.finish]
    K --> L[Render in editor]
Loading

Reviews (4): Last reviewed commit: "revert: keys from wrong merge" | Re-trigger Greptile

Comment thread local.properties Outdated
Comment on lines +1 to +8
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon May 25 14:58:09 IST 2026
sdk.dir=C\:\\Users\\jainy\\AppData\\Local\\Android\\Sdk
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Developer-specific file committed to version control

This file contains a machine-specific Windows SDK path (sdk.dir=C:\Users\jainy\...) and the file header itself says it "must NOT be checked into Version Control Systems." Even though /local.properties was correctly added to .gitignore in this PR, the file is still being committed. Any developer who checks out this branch will have their own local.properties overwritten with a path that doesn't exist on their machine, breaking their Android build setup.

Comment thread src/cm/lineBreakMarker.ts Outdated
Comment thread local.properties Outdated
UnschooledGamer and others added 3 commits May 26, 2026 09:12
@UnschooledGamer

This comment was marked as resolved.

@UnschooledGamer UnschooledGamer changed the title Add visual line break marker toggle feat: visual line break marker toggle May 26, 2026
@UnschooledGamer UnschooledGamer changed the title feat: visual line break marker toggle feat(editor): togglable visual line break marker May 26, 2026
@UnschooledGamer

This comment was marked as outdated.

@UnschooledGamer

This comment has been minimized.

@bajrangCoder
Copy link
Copy Markdown
Member

@Elitex07 why we need two settings just for similar thing

Like there is already: show spaces settings so just make that better and reuse that instead of having two. One for space and other for line break

@Elitex07 Elitex07 force-pushed the feature/line-break-marker branch from f8b6c08 to 2121f2a Compare May 31, 2026 13:09
@Elitex07
Copy link
Copy Markdown
Author

merged those two options

@bajrangCoder
Copy link
Copy Markdown
Member

merged those two options

Okay

Btw why including lock files , properties files etc ? And also this pr also touched some irrelevant files which is not related to this pr

@UnschooledGamer
Copy link
Copy Markdown
Member

merged those two options

Okay

Btw why including lock files , properties files etc ? And also this pr also touched some irrelevant files which is not related to this pr

I18n keys needs to be removed too with lang npm script.

Gradle jvm properties file is fine, @types/cordova inclusion is good too except package-lock updation for other packages - which probably breaks biome.

@UnschooledGamer

This comment has been minimized.

@UnschooledGamer

This comment was marked as outdated.

@UnschooledGamer
Copy link
Copy Markdown
Member

@bajrangCoder Review again, and what you think about “was broadened to mention line break markers, but the description does not convey the textWrap dependency — users who enable showSpaces without textWrap will not see line break markers despite what the description implies.”

Also, More i18n translation has to be done for the show spaces description in other languages.

@UnschooledGamer UnschooledGamer changed the title feat(editor): togglable visual line break marker feat(editor): togglable visual line break marker via show spaces option May 31, 2026
@bajrangCoder
Copy link
Copy Markdown
Member

@bajrangCoder Review again, and what you think about “was broadened to mention line break markers, but the description does not convey the textWrap dependency — users who enable showSpaces without textWrap will not see line break markers despite what the description implies.”

Also, More i18n translation has to be done for the show spaces description in other languages.

It's fine as show spaces and line breaks things are just related similar thing just a bit different behaviour in different scenarios.
Description like : "Display visible whitespace markers and line breaks" , will be enough

@UnschooledGamer
Copy link
Copy Markdown
Member

@bajrangCoder Review again, and what you think about “was broadened to mention line break markers, but the description does not convey the textWrap dependency — users who enable showSpaces without textWrap will not see line break markers despite what the description implies.”

Also, More i18n translation has to be done for the show spaces description in other languages.

It's fine as show spaces and line breaks things are just related similar thing just a bit different behaviour in different scenarios.
Description like : "Display visible whitespace markers and line breaks" , will be enough

I think the textWrap requirement for it needs to be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request translations Anything related to Translations Whether a Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants