aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-10-19 22:58:24 +0200
committerThomas White <taw@physics.org>2017-10-19 22:58:24 +0200
commitf1343f115ab92caa1c8758c56e45391fa6fd2715 (patch)
tree297e76d744c61f2cad2de6126e9f39a3cb4c4192
parentbc779857fd04c84ec3bab92967c272ffa7899c7e (diff)
Remove more unnecessary messing around with \n
-rw-r--r--src/frame.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/frame.c b/src/frame.c
index 010394f..c778793 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -989,7 +989,6 @@ static void delete_text_paragraph(Paragraph *para, int p, struct frame *fr)
int j;
struct text_run *run;
- size_t nl = 0;
run = &para->runs[i];
@@ -998,22 +997,12 @@ static void delete_text_paragraph(Paragraph *para, int p, struct frame *fr)
continue;
}
- /* Find the newline at the end of the paragraph, if it
- * exists */
- size_t toffs = run->scblock_offs_bytes + run->len_bytes;
- if ( sc_block_contents(run->scblock)[toffs] == '\n' ) {
- printf("Found newline when deleting paragraph\n");
- nl = 1;
- } else {
- printf("No newline when deleting paragraph\n");
- }
-
/* Delete from the corresponding SC block */
scblock_delete_text(run->scblock, run->scblock_offs_bytes,
- run->scblock_offs_bytes + run->len_bytes+nl);
+ run->scblock_offs_bytes + run->len_bytes);
/* Fix up the offsets of the subsequent text runs */
- size_t del_len = run->len_bytes + nl;
+ size_t del_len = run->len_bytes;
run->len_bytes -= del_len;
for ( j=i+1; j<para->n_runs; j++ ) {
if ( para->runs[j].scblock == run->scblock ) {