bdrf data = { 0 };
int new_index;
int col;
- GtkSPropertyMark mark = find_this_line_start_mark(text, text->cursor_mark.index, &text->cursor_mark);
+ GtkSPropertyMark mark;
+
+ mark = find_this_line_start_mark(text, text->cursor_mark.index, &text->cursor_mark);
/* top of buffer */
if (mark.index == 0) {
- XDEBUG ( ("%s(%d) top of buffer", __FILE__, __LINE__) );
- return;
+ XDEBUG ( ("%s(%d) top of buffer", __FILE__, __LINE__) );
}
- /* we need to previous DISPLAY row not the previous BUFFER line, so we go one line back,
- * and iterate over the lines until we have a LineParams that matches the original */
-
+ /* we need previous DISPLAY row not the previous BUFFER line, so we go to start
+ * of paragraph, and iterate over the lines until we have a LineParams that matches
+ * the original */
lp = CACHE_DATA(text->current_line);
col = (text->cursor_mark.index - lp.start.index);
data.start = lp.start.index;
data.end = lp.end.index;
/* get the previous line */
- if (mark.index - 1 > 0) {
+ if (mark.index != 0) {
decrement_mark(&mark);
- XDEBUG( ("%s(%d) mark decrement", __FILE__, __LINE__) );
- if (mark.index - 1 > 0) {
+ if (mark.index != 0) {
GtkSPropertyMark smark = mark;
XDEBUG( ("%s(%d) finding line start mark", __FILE__, __LINE__) );
mark = find_this_line_start_mark(text, smark.index -1, &smark);
fdrf *data)
{
if (data->found) {
+ XDEBUG( ("%s(%d) - FW RETURNS. search (%d, %d), current (%d, %d)",
+ __FILE__, __LINE__, data->start, data->end, lp->start.index, lp->end.index) );
data->lp = *lp;
data->completed = TRUE;
return TRUE;
}
else if (range_intersect(data->start, data->end, lp->start.index, lp->end.index)) {
+ XDEBUG( ("%s(%d) - FW FOUND IT. search (%d, %d), current (%d, %d)",
+ __FILE__, __LINE__, data->start, data->end, lp->start.index, lp->end.index) );
data->found = TRUE;
return FALSE;
}
LineParams lp;
int new_index;
int col;
- GtkSPropertyMark mark = find_this_line_start_mark(text, text->cursor_mark.index, &text->cursor_mark);
+ GtkSPropertyMark mark;
fdrf data = { FALSE, FALSE };
+ mark = find_this_line_start_mark(text, text->cursor_mark.index, &text->cursor_mark);
lp = CACHE_DATA(text->current_line);
col = (text->cursor_mark.index - lp.start.index);
data.start = lp.start.index;
data.end = lp.end.index;
- /* find the next DISPLAY line */
+ /* find the next DISPLAY line */
+ XDEBUG( ("%s(%d) - FW iterating", __FILE__, __LINE__) ) ;
line_params_iterate(text, &mark, NULL, FALSE, &data,
(LineIteratorFunction)forward_display_row_fetcher);
+ XDEBUG( ("%s(%d) - FW done iterating", __FILE__, __LINE__) );
if (data.completed) {
if (col < text->persist_column) col = text->persist_column;
new_index = data.lp.end.index;
}
/* and move the cursor */
+ XDEBUG( ("%s(%d) - FW set pos %d", __FILE__, __LINE__, new_index) );
gtk_stext_set_position_X(GTK_EDITABLE(text), new_index);
}
}