1. 22 Mar, 2017 9 commits
    • David Lawrence Ramsey's avatar
      softwrap: iterate through softwrapped chunks in edit_scroll() · ba4858de
      David Lawrence Ramsey authored
      Use go_back_chunks() and go_forward_chunks() to adjust edittop and to
      move up or down to the scrolled region before updating the rows there.
      Now softwrap mode and non-softwrap mode will behave the same way when
      we can scroll the top line of the screen partially off the screen,
      which is forthcoming.
      
      (Note that the top line of the screen can't be partially scrolled yet,
      so we have to work around that for now.)
      ba4858de
    • David Lawrence Ramsey's avatar
      display: limit an optimization to non-softwrap mode · fa025f0c
      David Lawrence Ramsey authored
      Not drawing a line on a row if we're on the top row and scrolled down,
      or if we're on the bottom row and scrolled up, will only work properly
      if the line on that row takes up only that row.  The latter might not
      be the case in softwrap mode: if the line occupies multiple chunks and
      begins on that row -- in that case none of the chunks would be drawn.
      fa025f0c
    • David Lawrence Ramsey's avatar
      tweaks: rename need_horizontal_scroll() to line_needs_update() · eb369c0e
      David Lawrence Ramsey authored
      The old name made it sound as if it didn't apply in softwrap mode.  But
      it does: in softwrap mode a line needs updating  when the mark is on.
      eb369c0e
    • David Lawrence Ramsey's avatar
      softwrap: account for softwrap in get_page_start() · df2a4679
      David Lawrence Ramsey authored
      In softwrap mode, nano doesn't horizontally scroll lines at all, so in
      this case get_page_start() should always return zero.
      df2a4679
    • David Lawrence Ramsey's avatar
      softwrap: account for softwrap when checking whether current is offscreen · 380ad30a
      David Lawrence Ramsey authored
      Add the new functions current_is_above_screen() (which doesn't account
      for softwrapped chunks yet, but will when we can scroll edittop partially
      off the screen, which is forthcoming), current_is_below_screen() (which
      determines whether current[current_x] is past the softwrapped chunk at
      the bottom of the screen), and current_is_offscreen() (the union of the
      previous two functions).
      
      edit_redraw() and edit_refresh() now use current_is_offscreen() to check
      whether they should adjust the viewport, and adjust_viewport() now uses
      current_is_above_screen() to determine whether current is on or below
      the screen in FLOWING mode.
      380ad30a
    • David Lawrence Ramsey's avatar
      softwrap: count softwrapped chunks properly in read_file() · fd82989e
      David Lawrence Ramsey authored
      Use less_than_a_screenful() again, just as in do_uncut_text().
      fd82989e
    • David Lawrence Ramsey's avatar
      softwrap: count softwrapped chunks properly in do_uncut_text() · 4f9c563e
      David Lawrence Ramsey authored
      Add the new function less_than_a_screenful() to accomplish this.
      It uses go_back_chunks() to count the number of softwrapped chunks
      between the end point and the starting point of the paste.
      
      Now softwrap mode and non-softwrap mode behave the same way when
      uncutting fewer than editwinrows rows of text.  Accordingly, remove
      the call to ensure_line_is_visible(), as it no longer applies.
      4f9c563e
    • David Lawrence Ramsey's avatar
      softwrap: count softwrapped chunks properly in do_gotolinecolumn() · 1570651e
      David Lawrence Ramsey authored
      Use go_forward_chunks() to count softwrapped chunks between the current
      cursor position and the bottom of the file.  Now softwrap mode and
      non-softwrap mode behave the same way when moving to a line and column
      non-interactively, instead of the former's always centering the screen.
      1570651e
    • David Lawrence Ramsey's avatar
      softwrap: add two chunk-iterator functions · 456d66b9
      David Lawrence Ramsey authored
      These functions, go_back_chunks() and go_forward_chunks(), take a number
      of softwrapped chunks (screen rows) to move, a pointer to a buffer, and
      a location (specifically, a starting column of a softwrapped chunk).  If
      they move successfully, they will update the buffer pointer and location
      to point to the beginning of the softwrapped chunk they moved to.
      
      Since non-softwrap mode is effectively just a subset of softwrap mode
      in which every line takes up one chunk, these functions also work in
      non-softwrap mode.  In this case, their starting column will always be
      zero, as it would be in softwrap mode on a line that takes up one chunk.
      
      Nothing uses these functions yet, but that is forthcoming.
      456d66b9
  2. 20 Mar, 2017 4 commits
  3. 16 Mar, 2017 1 commit
  4. 14 Mar, 2017 2 commits
  5. 09 Mar, 2017 1 commit
  6. 08 Mar, 2017 1 commit
  7. 06 Mar, 2017 19 commits
  8. 01 Mar, 2017 3 commits