# Editor maximum width issue

**URL:** <https://discourse.joplinapp.org/t/editor-maximum-width-issue/41551>\
**Category:** Support\
**Created:** [25 October 2024 00:35 UTC](https://discourse.joplinapp.org/t/editor-maximum-width-issue/41551 "2024-10-25T00:35:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [25 October 2024 03:40 UTC](https://discourse.joplinapp.org/t/editor-maximum-width-issue/41551/2 "2024-10-25T03:40:18Z")

</div>

Thank you for reporting this!

I'm attaching a screenshots from before and after to illustrate the difference:

## Screenshot comparison

**Legacy editor:** (CodeMirror 5; General \> Advanced \> Legacy Markdown editor):

 ![screenshot: CodeMirror 5 editor has no left margin](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/5/3/530b5c01139300ed6cc58341e80c5d4d596df498.png)

**New editor** : (CodeMirror 6)

 ![screenshot: CodeMirror 6 editor has a left margin](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/c/b/cba9631e43b24736655d60388781bcd10a8f4ccd.png)

## Development notes

- The 15px left-right margin is on the `.cm-content` element.
  - This comes from the use of `theme.marginLeft` in [`theme.ts`](https://github.com/laurent22/joplin/blob/db966f919ea51f5f32fa454a10c7a64957a4e9de/packages/editor/CodeMirror/theme.ts#L97).

- Each `.cm-line` has an additional `2px` left-edge padding.
  - This also seems to be present in the [upstream CodeMirror example editor](https://codemirror.net/).
  - It should be possible to override in [`theme.ts`](https://github.com/laurent22/joplin/blob/db966f919ea51f5f32fa454a10c7a64957a4e9de/packages/editor/CodeMirror/theme.ts).

> **Workarounds**
>
> 1. Re-enable the legacy editor
> 2. Add the following [custom CSS](https://discourse.joplinapp.org/t/introduction-to-customising-joplin-userchrome-css-userstyle-css/21370):
> 
> ```css
> .CodeMirror .cm-line {
> padding-left: 0;
> }
> 
> .CodeMirror .cm-content {
> margin-left: 0;
> margin-right: 0;
> }   
> 
> ```

---

_[View the full topic](https://discourse.joplinapp.org/t/editor-maximum-width-issue/41551)._
