Normalizing whitespace, comments and interpunction, in various places.

Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4938 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2014-06-04 16:02:51 +00:00
parent ac1508c49e
commit 1de337de9c
9 changed files with 42 additions and 34 deletions

View File

@ -1,3 +1,7 @@
2014-06-04 David Lawrence Ramsey <pooka109@gmail.com>
* src/*.c: Adjustments of whitespace and comments.
* doc/nanorc.sample.in: Interpunction tweaks.
2014-06-02 Chris Allegretta <chrisa@asty.org> 2014-06-02 Chris Allegretta <chrisa@asty.org>
* doc/syntax/default.nanorc: Can't do trailing spaces in the * doc/syntax/default.nanorc: Can't do trailing spaces in the
default syntax or it will hilight the spaces as you type default syntax or it will hilight the spaces as you type

View File

@ -61,7 +61,7 @@
## Enable vim-style lock-files. This is just to let a vim user know you ## Enable vim-style lock-files. This is just to let a vim user know you
## are editing a file [s]he is trying to edit and vice versa. There are ## are editing a file [s]he is trying to edit and vice versa. There are
## no plans to implement vim-style undo state in these files ## no plans to implement vim-style undo state in these files.
# set locking # set locking
## The opening and closing brackets that can be found by bracket ## The opening and closing brackets that can be found by bracket
@ -162,7 +162,7 @@
## Convert typed tabs to spaces. ## Convert typed tabs to spaces.
# set tabstospaces # set tabstospaces
## Save automatically on exit, don't prompt. ## Save automatically on exit; don't prompt.
# set tempfile # set tempfile
## Enable the new (EXPERIMENTAL) generic undo code, not just for line ## Enable the new (EXPERIMENTAL) generic undo code, not just for line
@ -186,7 +186,7 @@
## Paint the interface elements of nano. ## Paint the interface elements of nano.
## This is an example, by default there are no colors. ## This is an example; by default there are no colors.
# set titlecolor brightwhite,blue # set titlecolor brightwhite,blue
# set statuscolor brightwhite,green # set statuscolor brightwhite,green
# set keycolor green # set keycolor green

View File

@ -128,7 +128,6 @@ char *do_browser(char *path, DIR *dir)
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
if (kbinput == KEY_MOUSE) { if (kbinput == KEY_MOUSE) {
int mouse_x, mouse_y; int mouse_x, mouse_y;
/* We can click on the edit window to select a /* We can click on the edit window to select a

View File

@ -261,7 +261,8 @@ bool regexp_bol_or_eol(const regex_t *preg, const char *string)
/* Fix the regex if we're on platforms which require an adjustment /* Fix the regex if we're on platforms which require an adjustment
* from GNU-style to BSD-style word boundaries. */ * from GNU-style to BSD-style word boundaries. */
const char *fixbounds(const char *r) { const char *fixbounds(const char *r)
{
#ifndef GNU_WORDBOUNDS #ifndef GNU_WORDBOUNDS
int i, j = 0; int i, j = 0;
char *r2 = charalloc(strlen(r) * 5); char *r2 = charalloc(strlen(r) * 5);

View File

@ -2495,10 +2495,11 @@ void edit_draw(filestruct *fileptr, const char *converted, int
/* First simply paint the line -- then we'll add colors or the /* First simply paint the line -- then we'll add colors or the
* marking highlight on just the pieces that need it. */ * marking highlight on just the pieces that need it. */
mvwaddstr(edit, line, 0, converted); mvwaddstr(edit, line, 0, converted);
/* Tell ncurses to really redraw the line without trying to optimize
for what it thinks is already there, because it gets it wrong in
the case of a wide character in column zero. See bug #31743. */
#ifndef USE_SLANG #ifndef USE_SLANG
/* Tell ncurses to really redraw the line without trying to optimize
* for what it thinks is already there, because it gets it wrong in
* the case of a wide character in column zero. See bug #31743. */
wredrawln(edit, line, 1); wredrawln(edit, line, 1);
#endif #endif
@ -2508,13 +2509,15 @@ void edit_draw(filestruct *fileptr, const char *converted, int
if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX)) { if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX)) {
const colortype *tmpcolor = openfile->colorstrings; const colortype *tmpcolor = openfile->colorstrings;
/* Set up multi-line color data for this line if it's not yet calculated. */ /* Set up multi-line color data for this line if it's not yet
* calculated. */
if (fileptr->multidata == NULL && openfile->syntax if (fileptr->multidata == NULL && openfile->syntax
&& openfile->syntax->nmultis > 0) { && openfile->syntax->nmultis > 0) {
int i; int i;
fileptr->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short)); fileptr->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
for (i = 0; i < openfile->syntax->nmultis; i++) for (i = 0; i < openfile->syntax->nmultis; i++)
fileptr->multidata[i] = -1; /* Assume this applies until we know otherwise. */ /* Assume this applies until we know otherwise. */
fileptr->multidata[i] = -1;
} }
for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) { for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
int x_start; int x_start;
@ -2601,7 +2604,8 @@ void edit_draw(filestruct *fileptr, const char *converted, int
short md = fileptr->multidata[tmpcolor->id]; short md = fileptr->multidata[tmpcolor->id];
if (md == -1) if (md == -1)
fileptr->multidata[tmpcolor->id] = CNONE; /* until we find out otherwise */ /* Assume this until we know otherwise. */
fileptr->multidata[tmpcolor->id] = CNONE;
else if (md == CNONE) else if (md == CNONE)
goto end_of_loop; goto end_of_loop;
else if (md == CWHOLELINE) { else if (md == CWHOLELINE) {