You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From a project I'm working on, no wrap neither horizontally nor vertically and growing/shrinking with size
(the horizontal wrap part is /* always wrap content */):
Even if it did work on Feb 9, ukusormus' solution won't work with major version 3; the equivalent functionality would be good to add as a plugin in v3.0.0
The Autocomplete plugin will need to be slightly adjusted to support this, by inserting all of the rest of the contents into the span element in the invisible pre. See here.
This should work on the latest version of code-input.js (and should keep working in all future version 2 releases); I've tested it briefly:
/* Add wrap CSS class to code-input elements with wrapped contents */code-input.wraptextarea,code-input.wrap:not(.code-input_pre-element-styled) precode,code-input.wrap.code-input_pre-element-styledpre {
white-space: pre-wrap;
width:calc(100%-var(--padding-left,16px) -var(--padding-right,16px))!important;
}
If you're using prism-line-numbers, let me know and I can write similar CSS to work with wrap+line-numbers code-input elements.
Activity
ukusormus commentedon Aug 1, 2024
From a project I'm working on, no wrap neither horizontally nor vertically and growing/shrinking with size
(the horizontal wrap part is
/* always wrap content */):using code-input 2.3:
style fixes:
// edit: cool plugin btw!
WebCoder49 commentedon Aug 2, 2024
@ukusormus Thank you very much for this! When I have time, I'll add this to the documentation.
ivanperez-keera commentedon Feb 9, 2025
This doesn't work for me. The cursor is in the next line, but the visible content scrolls right.
WebCoder49 commentedon Jul 18, 2025
Even if it did work on Feb 9, ukusormus' solution won't work with major version 3; the equivalent functionality would be good to add as a plugin in v3.0.0
WebCoder49 commentedon Dec 10, 2025
The
Autocompleteplugin will need to be slightly adjusted to support this, by inserting all of the rest of the contents into thespanelement in the invisiblepre. See here.WebCoder49 commentedon Sep 16, 2026
This should work on the latest version of code-input.js (and should keep working in all future version 2 releases); I've tested it briefly:
If you're using
prism-line-numbers, let me know and I can write similar CSS to work with wrap+line-numbers code-input elements.WebCoder49 commentedon Sep 16, 2026
Similarly, if you're using the
autogrowplugin, the CSS might also need a change. Let me know if you're using it.