internal override void format_before_do_replace(format_cell cell) { // see if on view if (cell.location != format_cell.location_type.view) { return; } if (!show_multi_into_single_line_) { return; } // ... make sure we catch all lines var lines = cell.format_text.text.Replace("\r\n", "\r").Replace("\n", "\r").Split(new[] { "\r" }, StringSplitOptions.None); if (lines.Length <= 1) { return; // single line } var new_text = util.concatenate(lines, separator_); cell.format_text.replace_text(0, cell.format_text.text.Length, new_text); if (alternate_format_ != null || separator_format_ != null) { if (alternate_format_ != null) { alternate_format_.update_colors(cell); } if (separator_format_ != null) { separator_format_.update_colors(cell); } int cur_idx = 0; var line_indexes = new List <int>(); foreach (var line in lines) { line_indexes.Add(cur_idx); cur_idx += line.Length + separator_.Length; } List <text_part> parts = new List <text_part>(); for (int i = 0; i < line_indexes.Count; i++) { bool even = i % 2 == 0; if (separator_format_ != null && i < line_indexes.Count - 1) { parts.Add(new text_part(line_indexes[i] + lines[i].Length, separator_.Length, separator_format_)); } if (!even) { // odd - show in alternate if (alternate_format_ != null) { parts.Add(new text_part(line_indexes[i], lines[i].Length, alternate_format_)); } } } cell.format_text.add_parts(parts); } }