Closed rpoovey closed 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
After
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.
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;
andwhite-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?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.