WordPress / better-code-editing

[✅ Merged into 4.9-alpha] Better Code Editing WordPress plugin
https://wordpress.org/plugins/better-code-editing/
37 stars 16 forks source link

Editor width doesn't account for extra space #5

Closed melchoyce closed 7 years ago

melchoyce commented 7 years ago

The inclusion of the line numbers increases the overall width of the editor, so it cuts into the list of files on the side:

With:

image

Without:

image

The editor should remain the same width, with the line numbers taking up room inside, rather than outside.

melchoyce commented 7 years ago

Related: https://core.trac.wordpress.org/ticket/41309 cc @karmatosed

westonruter commented 7 years ago

@melchoyce I don't think this is a problem. The main difference between the two editors, actually, is that CodeMirror does not wrap lines whereas a textarea does. We could enable lineWrapping option and that results in:

image

I'll also note that adding line-wrapping is a workaround fix for #32 as well.

melchoyce commented 7 years ago

Line-wrapping is good 👍 But the extra width is still a problem — notice in my before/after how the editor starts to run very close to the file list.

melchoyce commented 7 years ago

image

westonruter commented 7 years ago

But the extra width is still a problem — notice in my before/after how the editor starts to run very close to the file list.

Oh I see now. Fixed in https://github.com/WordPress/codemirror-wp/pull/33/commits/74859d1f4e8b8474e792475b86ba54527393241d via #33.