Skip to content

Commit 05cfb03

Browse files
fixes #14
1 parent 15e5199 commit 05cfb03

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

assets/javascripts/view_layouts_base_body_bottom_textile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ function styleSelectedText(textarea, prepend, append) {
1111
textarea.val($content);
1212
textarea.focus();
1313
textarea.prop('selectionStart', $start - prepend.length);
14-
textarea.prop('selectionEnd', $end - append.length);
14+
var end =
15+
textarea.prop('selectionEnd', $end - (append == "\n</pre>" ? append.replace("\n", '').length : append.length));
1516
} else {
1617
$content = $content.slice(0, $start) + prepend + $content.slice($start, $end) + append + $content.slice($end, $content.length);
1718
textarea.val($content);
1819
textarea.focus();
1920
textarea.prop('selectionStart', $start + prepend.length);
20-
textarea.prop('selectionEnd', $end + append.length);
21+
textarea.prop('selectionEnd', $end + (append == "\n</pre>" ? append.replace("\n", '').length : append.length));
2122
}
2223
}
2324

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name 'Redmine Shortcuts'
55
author 'Davide Giacometti'
66
description 'Provides useful keyboard shortcuts'
7-
version '0.5.2'
7+
version '0.5.3'
88
url 'https://github.com/davidegiacometti/redmine_shortcuts'
99
author_url 'https://github.com/davidegiacometti'
1010

0 commit comments

Comments
 (0)