cosmetic and #ifdef fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
8f1afee813
commit
8f4762a842
|
@ -110,6 +110,10 @@ CVS code -
|
||||||
do_gotolinecolumn()
|
do_gotolinecolumn()
|
||||||
- Add parameter allow_update to control whether the screen is
|
- Add parameter allow_update to control whether the screen is
|
||||||
updated after moving. (DLR)
|
updated after moving. (DLR)
|
||||||
|
do_gotopos()
|
||||||
|
- Only include this function when DISABLE_SPELLER isn't defined,
|
||||||
|
as the alternate spell checking code is now the only place
|
||||||
|
where it's used. (DLR)
|
||||||
- winio.c:
|
- winio.c:
|
||||||
edit_scroll(), edit_redraw(), edit_refresh()
|
edit_scroll(), edit_redraw(), edit_refresh()
|
||||||
- Clean up and simplify. (DLR)
|
- Clean up and simplify. (DLR)
|
||||||
|
|
|
@ -178,7 +178,7 @@ bool is_word_mbchar(const char *c, bool allow_punct)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* c is a control character. It displays as ^@, ^?, or ^[ch], where ch
|
/* c is a control character. It displays as ^@, ^?, or ^[ch], where ch
|
||||||
* is c + 64. We return that character. */
|
* is (c + 64). We return that character. */
|
||||||
char control_rep(char c)
|
char control_rep(char c)
|
||||||
{
|
{
|
||||||
/* Treat newlines embedded in a line as encoded nulls. */
|
/* Treat newlines embedded in a line as encoded nulls. */
|
||||||
|
@ -192,7 +192,7 @@ char control_rep(char c)
|
||||||
|
|
||||||
#ifdef NANO_WIDE
|
#ifdef NANO_WIDE
|
||||||
/* c is a wide control character. It displays as ^@, ^?, or ^[ch],
|
/* c is a wide control character. It displays as ^@, ^?, or ^[ch],
|
||||||
* where ch is c + 64. We return that wide character. */
|
* where ch is (c + 64). We return that wide character. */
|
||||||
wchar_t control_wrep(wchar_t wc)
|
wchar_t control_wrep(wchar_t wc)
|
||||||
{
|
{
|
||||||
/* Treat newlines embedded in a line as encoded nulls. */
|
/* Treat newlines embedded in a line as encoded nulls. */
|
||||||
|
@ -206,7 +206,7 @@ wchar_t control_wrep(wchar_t wc)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* c is a multibyte control character. It displays as ^@, ^?, or ^[ch],
|
/* c is a multibyte control character. It displays as ^@, ^?, or ^[ch],
|
||||||
* where ch is c + 64. We return that multibyte character. */
|
* where ch is (c + 64). We return that multibyte character. */
|
||||||
char *control_mbrep(const char *c, char *crep, int *crep_len)
|
char *control_mbrep(const char *c, char *crep, int *crep_len)
|
||||||
{
|
{
|
||||||
assert(c != NULL && crep != NULL && crep_len != NULL);
|
assert(c != NULL && crep != NULL && crep_len != NULL);
|
||||||
|
|
10
src/move.c
10
src/move.c
|
@ -214,13 +214,12 @@ void do_up(void)
|
||||||
|
|
||||||
assert(openfile->current_y == openfile->current->lineno - openfile->edittop->lineno);
|
assert(openfile->current_y == openfile->current->lineno - openfile->edittop->lineno);
|
||||||
|
|
||||||
/* Move the current line of the edit window up, and then get the
|
/* Move the current line of the edit window up. */
|
||||||
* equivalent x-coordinate of the current line. */
|
|
||||||
openfile->current = openfile->current->prev;
|
openfile->current = openfile->current->prev;
|
||||||
openfile->current_x = actual_x(openfile->current->data,
|
openfile->current_x = actual_x(openfile->current->data,
|
||||||
openfile->placewewant);
|
openfile->placewewant);
|
||||||
|
|
||||||
/* If we're on the first row of the edit window, scroll the edit
|
/* If we're on the first line of the edit window, scroll the edit
|
||||||
* window up one line if we're in smooth scrolling mode, or up half
|
* window up one line if we're in smooth scrolling mode, or up half
|
||||||
* a page if we're not. */
|
* a page if we're not. */
|
||||||
if (openfile->current_y == 0)
|
if (openfile->current_y == 0)
|
||||||
|
@ -251,13 +250,12 @@ void do_down(void)
|
||||||
|
|
||||||
assert(openfile->current_y == openfile->current->lineno - openfile->edittop->lineno);
|
assert(openfile->current_y == openfile->current->lineno - openfile->edittop->lineno);
|
||||||
|
|
||||||
/* Move the current line of the edit window down, and then get the
|
/* Move the current line of the edit window down. */
|
||||||
* equivalent x-coordinate of the current line. */
|
|
||||||
openfile->current = openfile->current->next;
|
openfile->current = openfile->current->next;
|
||||||
openfile->current_x = actual_x(openfile->current->data,
|
openfile->current_x = actual_x(openfile->current->data,
|
||||||
openfile->placewewant);
|
openfile->placewewant);
|
||||||
|
|
||||||
/* If we're on the last row of the edit window, scroll the edit
|
/* If we're on the last line of the edit window, scroll the edit
|
||||||
* window down one line if we're in smooth scrolling mode, or down
|
* window down one line if we're in smooth scrolling mode, or down
|
||||||
* half a page if we're not. */
|
* half a page if we're not. */
|
||||||
if (openfile->current_y == editwinrows - 1)
|
if (openfile->current_y == editwinrows - 1)
|
||||||
|
|
|
@ -4556,10 +4556,10 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifndef DISABLE_JUSTIFY
|
||||||
if (punct == NULL)
|
if (punct == NULL)
|
||||||
punct = mallocstrcpy(punct, ".?!");
|
punct = mallocstrcpy(NULL, ".?!");
|
||||||
|
|
||||||
if (brackets == NULL)
|
if (brackets == NULL)
|
||||||
brackets = mallocstrcpy(brackets, "'\")}]>");
|
brackets = mallocstrcpy(NULL, "'\")}]>");
|
||||||
|
|
||||||
if (quotestr == NULL)
|
if (quotestr == NULL)
|
||||||
quotestr = mallocstrcpy(NULL,
|
quotestr = mallocstrcpy(NULL,
|
||||||
|
|
|
@ -505,7 +505,7 @@ void do_replace(void);
|
||||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||||
bool interactive, bool save_pos, bool allow_update);
|
bool interactive, bool save_pos, bool allow_update);
|
||||||
void do_gotolinecolumn_void(void);
|
void do_gotolinecolumn_void(void);
|
||||||
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
|
#ifndef DISABLE_SPELLER
|
||||||
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
|
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
|
||||||
pos_pww);
|
pos_pww);
|
||||||
#endif
|
#endif
|
||||||
|
|
14
src/search.c
14
src/search.c
|
@ -437,11 +437,11 @@ void findnextstr_wrap_reset(void)
|
||||||
/* Search for a string. */
|
/* Search for a string. */
|
||||||
void do_search(void)
|
void do_search(void)
|
||||||
{
|
{
|
||||||
size_t old_pww = openfile->placewewant;
|
filestruct *fileptr = openfile->current;
|
||||||
size_t fileptr_x = openfile->current_x;
|
size_t fileptr_x = openfile->current_x;
|
||||||
|
size_t old_pww = openfile->placewewant;
|
||||||
int i;
|
int i;
|
||||||
bool didfind;
|
bool didfind;
|
||||||
filestruct *fileptr = openfile->current;
|
|
||||||
|
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
wrap_reset();
|
wrap_reset();
|
||||||
|
@ -513,10 +513,10 @@ void do_search(void)
|
||||||
/* Search for the next string without prompting. */
|
/* Search for the next string without prompting. */
|
||||||
void do_research(void)
|
void do_research(void)
|
||||||
{
|
{
|
||||||
size_t old_pww = openfile->placewewant;
|
|
||||||
size_t fileptr_x = openfile->current_x;
|
|
||||||
bool didfind;
|
|
||||||
filestruct *fileptr = openfile->current;
|
filestruct *fileptr = openfile->current;
|
||||||
|
size_t fileptr_x = openfile->current_x;
|
||||||
|
size_t old_pww = openfile->placewewant;
|
||||||
|
bool didfind;
|
||||||
|
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
wrap_reset();
|
wrap_reset();
|
||||||
|
@ -880,10 +880,10 @@ ssize_t do_replace_loop(const char *needle, const filestruct
|
||||||
/* Replace a string. */
|
/* Replace a string. */
|
||||||
void do_replace(void)
|
void do_replace(void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
filestruct *edittop_save, *begin;
|
filestruct *edittop_save, *begin;
|
||||||
size_t begin_x, pww_save;
|
size_t begin_x, pww_save;
|
||||||
ssize_t numreplaced;
|
ssize_t numreplaced;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (ISSET(VIEW_MODE)) {
|
if (ISSET(VIEW_MODE)) {
|
||||||
print_view_warning();
|
print_view_warning();
|
||||||
|
@ -1040,7 +1040,7 @@ void do_gotolinecolumn_void(void)
|
||||||
openfile->placewewant + 1, FALSE, TRUE, FALSE, TRUE);
|
openfile->placewewant + 1, FALSE, TRUE, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
|
#ifndef DISABLE_SPELLER
|
||||||
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
|
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
|
||||||
pos_pww)
|
pos_pww)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue