catppuccin / logseq

🦫 Soothing pastel theme for Logseq
MIT License
154 stars 4 forks source link

line wrapping in code block #41

Closed rpoovey closed 7 months ago

rpoovey commented 7 months ago

I have been trying to locate where to place the CSS for line wrapping in code blocks (``` created blocks).

Using the inspector I have added text-wrap: pretty; and white-space: pre-line; (the latter gives a black bar at the top of LogSeq, so I dont think this one is right. The former does what I want)... to the section below in the inspector does work, but then the cursor presents weirdly (see screeshot). Any suggestions?

*, :after, :before {

}

Screenshot 2024-04-22 at 2 07 55 PM As you can see, that long line between the two lines of wrapped text is the cursor... Its presently at the end of the line after css, but if I was to move the cursor to the start of the line it would still span all lines.

This sounds like maybe a Logseq bug but I wanted to check in and see if you thought maybe I'm just screwing up my css placement instead.

griimick commented 7 months ago

@rpoovey the code block is rendered using CodeMirror v5. Logseq allows users to pass options for CodeMirror through the config.edn file. (https://github.com/logseq/logseq/pull/3699)

Add the following lines in your config.edn which can be accessed via Setting > General Tab > Edit config.edn button

 :editor/extra-codemirror-options 
 { :lineWrapping true }

Before

image

After

image
rpoovey commented 7 months ago

My Otter!!! I've spent 3 damn hours looking in the CSS for this. You are an incredible human, I didnt even think to look in the config.edn... Thank you.