comparison src/indent.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 7347b34c275b
children 74fd4e045ea6
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
571 : vtarget)); 571 : vtarget));
572 572
573 /* #### This assertion must be true before the if statements are hit 573 /* #### This assertion must be true before the if statements are hit
574 but may possibly be wrong after the call to 574 but may possibly be wrong after the call to
575 point_in_line_start_cache if orig is outside of the visible 575 point_in_line_start_cache if orig is outside of the visible
576 region of the buffer. Handle this. 576 region of the buffer. Handle this. */
577 577 assert (elt >= 0);
578 This occurs sometimes if scroll-step is non-zero and the window
579 is very small. In this case it's not possible to lay out any lines
580 in the window and point_in_line_start_cache returns -1 because
581 the line cache is empty. In this case we will just return the
582 original point and hope for the best. */
583 if (elt < 0)
584 return orig;
585 578
586 /* Moving downward. */ 579 /* Moving downward. */
587 if (vtarget > 0) 580 if (vtarget > 0)
588 { 581 {
589 int cur_line = Dynarr_length (w->line_start_cache) - 1 - elt; 582 int cur_line = Dynarr_length (w->line_start_cache) - 1 - elt;
670 struct window *w; 663 struct window *w;
671 664
672 if (NILP (window)) 665 if (NILP (window))
673 window = Fselected_window (Qnil); 666 window = Fselected_window (Qnil);
674 667
675 CHECK_LIVE_WINDOW (window); 668 CHECK_WINDOW (window);
676 CHECK_INT (lines); 669 CHECK_INT (lines);
677 670
678 selected = (EQ (window, Fselected_window (Qnil))); 671 selected = (EQ (window, Fselected_window (Qnil)));
679 672
680 w = XWINDOW (window); 673 w = XWINDOW (window);
744 int lines; 737 int lines;
745 738
746 if (NILP (window)) 739 if (NILP (window))
747 window = Fselected_window (Qnil); 740 window = Fselected_window (Qnil);
748 741
749 CHECK_LIVE_WINDOW (window); 742 CHECK_WINDOW (window);
750 w = XWINDOW (window); 743 w = XWINDOW (window);
751 744
752 eobuf = BUF_ZV (XBUFFER (w->buffer)); 745 eobuf = BUF_ZV (XBUFFER (w->buffer));
753 bobuf = BUF_BEGV (XBUFFER (w->buffer)); 746 bobuf = BUF_BEGV (XBUFFER (w->buffer));
754 747
847 struct window *w; 840 struct window *w;
848 841
849 if (NILP (window)) 842 if (NILP (window))
850 window = Fselected_window (Qnil); 843 window = Fselected_window (Qnil);
851 844
852 CHECK_LIVE_WINDOW (window); 845 CHECK_WINDOW (window);
853 CHECK_INT (pixels); 846 CHECK_INT (pixels);
854 847
855 selected = (EQ (window, Fselected_window (Qnil))); 848 selected = (EQ (window, Fselected_window (Qnil)));
856 849
857 w = XWINDOW (window); 850 w = XWINDOW (window);