Skip to content

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

Open
Elitex07 wants to merge 27 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 27 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 activates alongside the existing Show Spaces toggle, plus a batch of locale-string updates and some dev-tooling additions (devcontainer lock, Gradle JVM properties, Cordova type declarations).

  • src/cm/lineBreakMarker.ts — new ViewPlugin that places a ¬ widget decoration at line.to for every non-final document line within the visible ranges; the RangeSetBuilder ordering and lastLineNumber deduplication guard are correct.
  • src/lib/editorManager.js — a new lineBreakMarkerCompartment is keyed to the existing showSpaces setting, correctly piggy-backing on the pre-existing update:showSpaces event that already calls applyOptions(["showSpaces"]).
  • .gitignore — reformatted and extended with new entries, but tsconfig.tsbuildinfo was accidentally omitted, leaving the TypeScript incremental-build artifact unignored.

Confidence Score: 4/5

Safe to merge after re-adding tsconfig.tsbuildinfo to .gitignore; all editor logic changes are correct.

The only substantive defect is in .gitignore: tsconfig.tsbuildinfo was dropped during reformatting, so TypeScript's incremental build artifact will be untracked and at risk of being committed in future PRs. The editor feature itself — the lineBreakMarkerPlugin, compartment wiring, and locale updates — is logically sound and correctly coupled to the existing showSpaces toggle.

.gitignore needs the tsconfig.tsbuildinfo entry restored before merging.

Important Files Changed

Filename Overview
src/cm/lineBreakMarker.ts New CodeMirror plugin rendering "¬" markers at the end of each non-final document line; algorithm is correct, visible-range iteration and RangeSetBuilder ordering are safe.
src/lib/editorManager.js Adds lineBreakMarkerCompartment keyed to the existing showSpaces setting; piggybacks correctly on the existing update:showSpaces event handler via applyOptions.
.gitignore Reformatted with /prefix and added new entries, but accidentally dropped tsconfig.tsbuildinfo, which means the TypeScript incremental build artifact will no longer be gitignored.
src/plugins/admob/src/www/ads/webview.ts Minor TypeScript cleanup: added explicit : any types and changed MobileAdOptions to export type; no logic changes.
src/lang/en-us.json Updated settings-info-editor-show-spaces to mention line break markers alongside whitespace; same update mirrored across all 27 locale files.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User toggles Show Spaces setting"] --> B["appSettings.on('update:showSpaces')"]
    B --> C["applyOptions(['showSpaces'])"]
    C --> D["whitespaceCompartment.reconfigure(...)"]
    C --> E["lineBreakMarkerCompartment.reconfigure(...)"]
    D --> F{showSpaces enabled?}
    E --> G{showSpaces enabled?}
    F -- Yes --> H["highlightWhitespace() + trailing whitespace"]
    F -- No --> I["[] (disabled)"]
    G -- Yes --> J["lineBreakMarkerPlugin + lineBreakMarkerTheme"]
    G -- No --> K["[] (disabled)"]
    J --> L["ViewPlugin renders ¬ at line.to for each non-final visible line"]
Loading

Reviews (5): Last reviewed commit: "chore(i18n): translate updated string vi..." | 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.

@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

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

Hm

@UnschooledGamer

This comment has been minimized.

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