Skip to content

Commit fb2f8c8

Browse files
author
Daniel Herzog
committed
Simpler regexp; Fixed set_textarea_dimensions
1 parent 9a1c511 commit fb2f8c8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/network/network_request_crafting_view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ cls.RequestCraftingView = function(id, name, container_class, html, default_hand
7272
this._parse_request = function(requeststr)
7373
{
7474
var retval = {};
75-
var lines = requeststr.split(/(?:\r\n|\n)/);
75+
var lines = requeststr.split(/\r?\n/);
7676
var requestline = lines.shift();
7777
var reqparts = requestline.match(/(\w*?) (.*) (.*)/);
7878

src/ui-scripts/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ var BaseEditor = new function()
7474
// TODO force new lines if needed
7575
var
7676
max_content_length =
77-
Math.max.apply(null, this.textarea.value.split('\r\n').map(function(item){
77+
Math.max.apply(null, this.textarea.value.split(/\r?\n/).map(function(item){
7878
return item.length
7979
})),
8080
width = this.char_width * max_content_length;

0 commit comments

Comments
 (0)