We are currently planning to migrate to a different platform for the forum. We will announce this fact both here and on Twitter, once we have settled on a solution.

Wrapping lines in the editor?

In the editor I have a problem with long lines running off the page (to the right). Is there a way to set page margins and cause long lines to wrap automatically?

Comments

  • edited September 2020

    Does this happen only when the window is narrow? If so, then one solution would be to add this to your custom css (menu > Custom css):

    #editor {
      max-width: 850px;
    }
    

    It sets a maximum width for the content column. And when the window is narrow, the content wraps.
    Hope this helps.

    Edit: that doesn't work very well, as the tabs are included in that dimension, and the scrollbar comes inside the content.

    Maybe try this instead:

    .CodeMirror .CodeMirror-sizer {max-width:850px;}

  • @samueldee said:
    Does this happen only when the window is narrow? If so, then one solution would be to add this to your custom css (menu > Custom css):

    #editor {
      max-width: 850px;
    }
    

    It sets a maximum width for the content column. And when the window is narrow, the content wraps.
    Hope this helps.

    Edit: that doesn't work very well, as the tabs are included in that dimension, and the scrollbar comes inside the content.

    Maybe try this instead:

    .CodeMirror .CodeMirror-sizer {max-width:850px;}

    I am also having this issue and know absolutely nothing about coding, where to find the CSS file, or where to put it, if and when I would find it.

    Any help would be great, as I am in the infant stages here.

    Thanks so much.

  • I did somehow figure this out. I am not sure if I put it into the correct place, but it fixed the problem and everything else seems to be working properly.

    The place I put the command text mentioned above, is:
    Zettlr/custom.css

    There was not anything in there previously, other than that which said /* Enter your custom CSS here */

  • @Harvison said:
    I did somehow figure this out. I am not sure if I put it into the correct place, but it fixed the problem and everything else seems to be working properly.

    The place I put the command text mentioned above, is:
    Zettlr/custom.css

    There was not anything in there previously, other than that which said /* Enter your custom CSS here */

    That's the file that you can also edit using the Custom CSS settings (Menu: File->Custom CSS or Zettlr -> Custom CSS depending on your operating system)

  • That is good to know @hendrik . I found it looking through the finder on a Mac.

Sign In or Register to comment.