It's all set now! Breakline at any point & it maintains position (all while trying to use the most up to date browser techniques with fallbacks for IE, etc).
UPDATED x2 - jsFiddle link
$('#sillyTextarea').keydown(function (e) {
if (e.keyCode === 10 || e.keyCode == 13 && e.ctrlKey) {
// Ctrl-Enter pressed
// keyCode 10 is actually for Chrome (whacky I know...)
var el = document.getElementById('sillyTextarea'),
allText = $(this).val(),
currentPos = getCaret(el),
beforeText = allText.substr(0, currentPos),
afterText = allText.substr(currentPos);
$(this).val(beforeText + '\n' + afterText);
setCaretPosition(el, currentPos);
}
});
With help of 2 functions
function getCaret(el) { }
Caret position in textarea, in characters from the start
function setCaretPosition(el, caretPos) { }
Set keyboard caret position in html textbox