By definition, a code or pre tag set forces the website to ignore formatting/tags within the wrapping tag.
You could attempt to force it to wrap, by adding in line breaks into your source view.
In many cases that wont affect the display or operation of your code, but in more traditional systems, most code isn't that long, or has line breaks added for clarity manually. So the code view isn't designed to do forced line breaks, or line wrap. It could potentially be done if the object was to restricte the code block to x width, but that would break how the code is meant to be displayed and defeat the purpose of a code view.
ie
if X=Y then
{do this and this;}
or
{do this and this other thing;}
end if
When I deal with proxy.pac files which are javascript, and with stylesheets I often have
if (
shpExpMatch(url,"*domain*") ||
shpExpMatch(url,"*domain2*))
return {direct;}
This is the head section of this websites page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="https://elliquiy.com/forums/Themes/elliquiy2/css/index.css?r=1" />
<link rel="stylesheet" type="text/css" href="https://elliquiy.com/forums/Themes/elliquiy2/css/elliquiy_widescreen.css?r=b" />
<script src="/forums/chat/js/chat.js" type="text/javascript" charset="UTF-8"></script>
<script src="/forums/chat/js/lang/en.js" type="text/javascript" charset="UTF-8"></script>
<script src="/forums/chat/js/config.js" type="text/javascript" charset="UTF-8"></script>
<script src="/forums/chat/js/FABridge.js" type="text/javascript" charset="UTF-8"></script>
<script src="/forums/chat/js/shoutbox.js" type="text/javascript" charset="UTF-8"></script>
<script src="/forums/elliquiy.min.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript" src="https://elliquiy.com/forums/Themes/default/scripts/script.js?fin20"></script>
<script type="text/javascript" src="https://elliquiy.com/forums/Themes/elliquiy2/scripts/theme.js?fin20"></script>
<script type="text/javascript">
function hideSecond(el){el2=el.nextSibling;el2.style.display=(el2.style.display=="block")?"none":"block";}
</script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "https://elliquiy.com/forums/Themes/elliquiy2";
var smf_default_theme_url = "https://elliquiy.com/forums/Themes/default";
var smf_images_url = "https://elliquiy.com/forums/Themes/elliquiy2/images";
var smf_scripturl = "https://elliquiy.com/forums/index.php";
var smf_iso_case_folding = false;
var smf_charset = "ISO-8859-1";
var ajax_notification_text = "Loading...";
var ajax_notification_cancel_text = "Cancel";
// ]]></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="viewport" content="width=1024">
<meta name="description" content="Elliquiy Role Playing Forums - Index" />
<meta name="keywords" content="Roleplaying, Role Playing, RP, Roleplay, Adult, Sex, Sexual, Mature, Erotic" />
<title>Elliquiy Role Playing Forums - Index</title>
<link rel="canonical" href="https://elliquiy.com/forums/index.php" />
<link rel="help" href="https://elliquiy.com/forums/index.php?action=help" />
<link rel="search" href="https://elliquiy.com/forums/index.php?action=search" />
<link rel="contents" href="https://elliquiy.com/forums/index.php" />
<link rel="alternate" type="application/rss+xml" title="Elliquiy Role Playing Forums - RSS" href="https://elliquiy.com/forums/index.php?type=rss;action=.xml" />
</head>
See how its laid out manualy to assist with reading, normally in Code View?
The latter example obviously has a max height set, but not a width, which is why it scrolls vertical, without breaking how the code is displayed.
Often code viewers will also do syntax highlighting to make it easier to identify elements, and to spot missed closed strings or tags.