diff --git a/ChangeLog b/ChangeLog index ab8baf4ecffe1f223715860107a6c1ef4493ebc1..c34121d45f39a22d5d63422807932d0db9d92690 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-05-16 David Lawrence Ramsey <pooka109@gmail.com> + * src/color.c, src/cut.c, src/text.c: Tweak some whitespace. + * src/global.c, src/move.c: Use TRUE and FALSE instead of 1 and 0. + * src/winio.c (edit_draw): Mention the name of the tickling character. + 2014-05-15 Mark Majeres <mark@engine12.com> * src/*, but mainly src/text.c (undo_cut, redo_cut, do_undo, do_redo): Go to the correct positions for undoing/redoing the cuts and pastes. diff --git a/src/color.c b/src/color.c index 82febc07735c41fdaaf4bf8dde6f5cefbc517e4b..7e8e1a40ea3ba1ed9caedb3ccc6eb3a5b0607a47 100644 --- a/src/color.c +++ b/src/color.c @@ -392,7 +392,6 @@ void reset_multis_before(filestruct *fileptr, int mindex) else break; } - edit_refresh_needed = TRUE; } diff --git a/src/cut.c b/src/cut.c index 823ec6fb50c833eef1ac603a0b0ab11e6d8dbf9d..6f98e743ddce8c84db931cc1eb7050b6438376bb 100644 --- a/src/cut.c +++ b/src/cut.c @@ -44,7 +44,7 @@ void cutbuffer_reset(void) * current line. */ void cut_line(void) { - if(!openfile->mark_begin) + if (!openfile->mark_begin) openfile->mark_begin = openfile->current; if (openfile->current != openfile->filebot) diff --git a/src/global.c b/src/global.c index 453abd41dfa59e97554993c3930eda6617792e0e..b65f2c7d301f16ed28d075be347cad76aa840ee5 100644 --- a/src/global.c +++ b/src/global.c @@ -157,7 +157,7 @@ char *syntaxstr = NULL; #endif -bool edit_refresh_needed = 0; +bool edit_refresh_needed = FALSE; /* Did a command mangle enough of the buffer refresh that we * should repaint the screen? */ diff --git a/src/move.c b/src/move.c index 355fa02793ee23832ef41306d3eac2342f425873..9d73f97f95f5a17c5c2980203552b1155492966b 100644 --- a/src/move.c +++ b/src/move.c @@ -33,7 +33,7 @@ void do_first_line(void) openfile->current_x = 0; openfile->placewewant = 0; - edit_refresh_needed = 1; + edit_refresh_needed = TRUE; } /* Move to the last line of the file. */ @@ -44,7 +44,7 @@ void do_last_line(void) openfile->placewewant = xplustabs(); openfile->current_y = editwinrows - 1; - edit_refresh_needed = 1; + edit_refresh_needed = TRUE; } /* Move up one page. */ diff --git a/src/text.c b/src/text.c index aee832e8b138f1b0e9ee1d1865f33b2f4b57a724..6a231e198b08228ab4d4a81ed5746751b8120f7c 100644 --- a/src/text.c +++ b/src/text.c @@ -140,7 +140,7 @@ void do_delete(void) if (ISSET(SOFTWRAP) && edit_refresh_needed == FALSE) if (strlenpt(openfile->current->data) / COLS != orig_lenpt / COLS) - edit_refresh_needed = TRUE; + edit_refresh_needed = TRUE; set_modified(); @@ -455,7 +455,6 @@ void do_undo(void) undidmsg = _("text delete"); len = strlen(f->data) + strlen(u->strdata) + 1; data = charalloc(len); - strncpy(data, f->data, u->begin); strcpy(&data[u->begin], u->strdata); strcpy(&data[u->begin + strlen(u->strdata)], &f->data[u->begin]); @@ -506,7 +505,7 @@ void do_undo(void) if (f->next) { filestruct *foo = f->next; f->data = (char *) nrealloc(f->data, strlen(f->data) + strlen(f->next->data) + 1); - strcat(f->data, f->next->data); + strcat(f->data, f->next->data); unlink_node(foo); delete_node(foo); } @@ -946,7 +945,7 @@ void add_undo(undo_type current_action) filestruct *fs_buff = cutbuffer; if (fs_buff->lineno == cutbottom->lineno) - u->begin = fs->current_x + get_totsize(fs_buff,cutbottom); + u->begin = fs->current_x + get_totsize(fs_buff, cutbottom); else { /* Advance fs_buff to the last line in the cutbuffer. */ while (fs_buff->lineno != cutbottom->lineno && fs_buff->next != NULL) diff --git a/src/winio.c b/src/winio.c index 73ab9a60ed3763afbf6c4009d8ef3f5da655e451..d8dfaef2a489e1209d7e0deb344b797690f84a2f 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2497,7 +2497,8 @@ void edit_draw(filestruct *fileptr, const char *converted, int mvwaddstr(edit, line, 0, converted); #ifdef ENABLE_UTF8 if (using_utf8()) - /* Tickle the terminal into displaying two-column characters properly. */ + /* Tickle the terminal into displaying two-column characters + * properly, using Unicode 00A0 (No-Break Space). */ mvwaddstr(edit, line, COLS - 1, "\xC2\xA0\x00"); #endif