non-blocking mode for keyboard input.
* src/winio.c: Relocate and correct a few comments.
* README.SVN: To build nano from svn, ssh is not required.
+ * src/*.c: Normalize whitespace around '==' comparison.
2014-04-14 Benno Schulenberg <bensberg@justemail.net>
* src/{proto.h,cut.c,nano.c,text.c}: Remove the unused parameter
'file_bot' from copy_from_filestruct(), and rename the other.
* src/*: Remove the unused parameter 'func_key' from get_shortcut(),
and subsequently from parse_browser_input() and parse_help_input().
- * src/*: Whitespace adjustments, plus a few comment tweaks.
+ * src/*: Adjust some whitespace and tweak a few comments.
* src/winio.c (getfuncfromkey): Elide variable and condense comment.
* src/text.c (break_line): Initialize a variable to avoid a compiler
warning, rename it to be more apt, add a comment, tweak some others,
* src/rcfile.c (check_vitals_mapped): Do not allow 'set quiet'
to suppress a fatal-error message, make sure the user sees it.
* src/color.c: Comment tweaks.
- * src/{*.h,*.c}, configure.ac:Convert all occurrences of
+ * src/{*.h,*.c}, configure.ac: Convert all occurrences of
#ifdef ENABLE_COLOR to #ifndef DISABLE_COLOR.
* src/nano.h: Comment tweaks.
* configure.ac: Move the enabling stuff to after the disablers.
variable possibly being used uninitialized.
2014-03-31 Chris Allegretta <chrisa@asty.org>
- * doc/syntax/go.nanorc: basic go syntax highlighting
+ * doc/syntax/go.nanorc: New file, basic go syntax highlighting.
2014-03-30 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/changelog.nanorc: New file, first attempt at colouring
TOGGLE(CASE_SENSITIVE);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
- } else if (s && s->scfunc == backwards_void) {
+ } else if (s && s->scfunc == backwards_void) {
TOGGLE(BACKWARDS_SEARCH);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
* things changed drastically for the precalculated multi values. */
nobegin = regexec(tmpcolor->start, fileptr->data, 1, &startmatch, 0);
noend = regexec(tmpcolor->end, fileptr->data, 1, &endmatch, 0);
- if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) {
+ if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) {
if (nobegin && noend)
continue;
} else if (fileptr->multidata[tmpcolor->id] == CNONE) {
if (stat(legacyhist, &hstat) != -1 && stat(nanohist, &hstat) == -1) {
- if (rename(legacyhist, nanohist) == -1)
+ if (rename(legacyhist, nanohist) == -1)
history_error(N_("Detected a legacy nano history file (%s) which I tried to move\nto the preferred location (%s) but encountered an error: %s"),
legacyhist, nanohist, strerror(errno));
else
/* Set type of function based on the string. */
function_type strtokeytype(const char *str)
{
- if (str[0] == 'M' || str[0] == 'm')
+ if (str[0] == 'M' || str[0] == 'm')
return META;
else if (str[0] == '^')
return CONTROL;
- else if (str[0] == 'F' || str[0] == 'f')
+ else if (str[0] == 'F' || str[0] == 'f')
return FKEY;
else
return RAWINPUT;
size_t endis_len = strlen(_("enable/disable"));
for (s = sclist; s != NULL; s = s->next)
- if (s->scfunc == do_toggle_void)
+ if (s->scfunc == do_toggle_void)
allocsize += strlen(_(flagtostr(s->toggle))) + endis_len + 9;
-
}
#endif
goto precalc_cleanup;
}
- while ((nostart = regexec(tmpcolor->start, &fileptr->data[startx], 1, &startmatch, 0)) == 0) {
+ while ((nostart = regexec(tmpcolor->start, &fileptr->data[startx], 1, &startmatch, 0)) == 0) {
/* Look for end, and start marking how many lines are
* encompassed which should speed up rendering later. */
startx += startmatch.rm_eo;
#endif
/* Look on this line first for end. */
- if (regexec(tmpcolor->end, &fileptr->data[startx], 1, &endmatch, 0) == 0) {
+ if (regexec(tmpcolor->end, &fileptr->data[startx], 1, &endmatch, 0) == 0) {
startx += endmatch.rm_eo;
fileptr->multidata[tmpcolor->id] |= CSTARTENDHERE;
#ifdef DEBUG
/* If we got a shortcut, or if there aren't any other characters
* waiting after the one we read in, we need to display all the
* characters in the input buffer if it isn't empty. */
- if (*have_shortcut || get_key_buffer_len() == 0) {
+ if (*have_shortcut || get_key_buffer_len() == 0) {
if (kbinput != NULL) {
/* Display all the characters in the input buffer at
* once, filtering out control characters. */
* that we're done after running or trying to run their
* associated functions. */
f = sctofunc((sc *) s);
- if (s->scfunc != 0 && s->execute == TRUE) {
- *ran_func = TRUE;
+ if (s->scfunc != 0 && s->execute == TRUE) {
+ *ran_func = TRUE;
if (f && (!ISSET(VIEW_MODE) || (f->viewok)))
f->scfunc();
}
* we've finished putting in an answer, reset the statusbar cursor
* position too. */
if (s) {
- if (s->scfunc == do_cancel || s->scfunc == do_enter_void ||
+ if (s->scfunc == do_cancel || s->scfunc == do_enter_void ||
ran_func) {
statusbar_x = old_statusbar_x;
statusbar_pww = old_pww;
/* If we left the prompt via Cancel or Enter, set the return value
* properly. */
- if (s && s->scfunc == do_cancel)
+ if (s && s->scfunc == do_cancel)
retval = -1;
else if (s && s->scfunc == do_enter_void)
retval = (*answer == '\0') ? -2 : 0;
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key);
- if (s && s->scfunc == do_cancel)
+ if (s && s->scfunc == do_cancel)
ok = -1;
#ifndef DISABLE_MOUSE
else if (kbinput == KEY_MOUSE) {
s = get_shortcut(currmenu, &i, &meta_key);
- if (s && s->scfunc == gototext_void) {
+ if (s && s->scfunc == gototext_void) {
/* Keep answer up on the statusbar. */
search_init(TRUE, TRUE);
set_modified();
- if (edit_refresh_needed == FALSE)
+ if (edit_refresh_needed == FALSE)
update_line(openfile->current, openfile->current_x);
}
if (WIFEXITED(spell_status) == 0 || WEXITSTATUS(spell_status))
return _("Error invoking \"spell\"");
- if (WIFEXITED(sort_status) == 0 || WEXITSTATUS(sort_status))
+ if (WIFEXITED(sort_status) == 0 || WEXITSTATUS(sort_status))
return _("Error invoking \"sort -f\"");
if (WIFEXITED(uniq_status) == 0 || WEXITSTATUS(uniq_status))