X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fedit_field.c;h=8a664e8ca9a47c84c1fd5a562d04dab9d6403c09;hp=5ac096dcfb7b59aba8c1a9b3ab690d79a978128e;hb=7ca9d1eb1a8a995514d4dee312bf136fba88ec62;hpb=06ae48ca77d71610e4d86d138a8fd19db84634ce diff --git a/test/edit_field.c b/test/edit_field.c index 5ac096dc..8a664e8c 100644 --- a/test/edit_field.c +++ b/test/edit_field.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 2003-2008,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: edit_field.c,v 1.15 2008/12/20 19:23:01 tom Exp $ + * $Id: edit_field.c,v 1.17 2011/01/15 18:15:11 tom Exp $ * * A wrapper for form_driver() which keeps track of the user's editing changes * for each field, and makes the result available as a null-terminated string @@ -288,7 +288,10 @@ static int offset_in_field(FORM * form) { FIELD *field = current_field(form); - return form->curcol + form->currow * field->dcols; + int currow, curcol; + + form_getyx(form, currow, curcol); + return curcol + currow * field->dcols; } static void @@ -308,10 +311,11 @@ edit_field(FORM * form, int *result) char lengths[80]; int length; char *buffer; - int before_row = form->currow; - int before_col = form->curcol; + int before_row; + int before_col; int before_off = offset_in_field(form); + form_getyx(form, before_row, before_col); before = current_field(form); set_field_back(before, A_NORMAL); if (ch <= KEY_MAX) {