1. 24 Apr, 2017 1 commit
  2. 19 Apr, 2017 1 commit
  3. 17 Apr, 2017 5 commits
  4. 09 Apr, 2017 2 commits
  5. 06 Apr, 2017 4 commits
  6. 04 Apr, 2017 2 commits
  7. 03 Apr, 2017 1 commit
  8. 29 Mar, 2017 2 commits
  9. 28 Mar, 2017 4 commits
  10. 24 Mar, 2017 2 commits
  11. 22 Mar, 2017 16 commits
    • Benno Schulenberg's avatar
      tweaks: ehm... the warning is more important for the softwrap case · e46c6c96
      Benno Schulenberg authored
      But apparently none of these cases occur, because I can't trigger them.
      e46c6c96
    • Benno Schulenberg's avatar
    • Benno Schulenberg's avatar
      painting: don't try to start highlighting before column zero · 55159b7b
      Benno Schulenberg authored
      This could happen when a tab or a double-width character straddles
      the boundary between two softwrapped chunks.
      55159b7b
    • David Lawrence Ramsey's avatar
      softwrap: adjust firstcolumn when the window width changes · 0389a1d9
      David Lawrence Ramsey authored
      If the number of columns in the edit window changes (which currently
      only happens in two places: in regenerate_screen(), called when the
      window is resized; and in main(), when line numbering mode is toggled),
      the display will break if we're in softwrap mode and firstcolumn is
      nonzero.  This is because the column width of softwrapped chunks has
      changed, and firstcolumn is no longer the starting column of a chunk,
      an assumption that all code using firstcolumn relies on.
      
      To fix this problem, add a new function, ensure_firstcolumn_is_aligned(),
      to adjust firstcolumn to the starting column of the chunk it's on, and
      use it when the number of columns in the edit window changes.
      
      (Note that this function uses the simplest possible fix, and could
      probably be made more sophisticated.)
      0389a1d9
    • David Lawrence Ramsey's avatar
      softwrap: move the updating of a softwrapped line to a new function · 2f6c8987
      David Lawrence Ramsey authored
      The new function, update_softwrapped_line(), is called from inside
      update_line() when softwrap mode is on, so that existing calls remain
      unchanged.  It takes no index, instead displaying edittop from column
      firstcolumn, and all other lines from column zero.
      
      If current is on edittop, it's displayed using the edittop rules, but
      this is not a problem: if current[current_x] is above edittop at column
      firstcolumn, it's offscreen, and that should be handled before calling
      update_line() anyway.
      
      Together with the preceding bunch of changes,
      this fixes https://savannah.gnu.org/bugs/?47667.
      2f6c8987
    • David Lawrence Ramsey's avatar
      softwrap: account for firstcolumn in reset_cursor() · 98b029cf
      David Lawrence Ramsey authored
      When counting rows in softwrap mode, reset_cursor() should compensate for
      the number of softwrapped chunks that edittop takes up before firstcolumn.
      98b029cf
    • David Lawrence Ramsey's avatar
      softwrap: account for firstcolumn when checking for offscreen current · c0fa3f04
      David Lawrence Ramsey authored
      Make current_is_above_screen() check for current[current_x] being above
      edittop at column firstcolumn, and make current_is_below_screen() start
      counting down from edittop at column firstcolumn instead of edittop at
      column zero.  This means that both functions now account for softwrapped
      chunks properly.
      c0fa3f04
    • David Lawrence Ramsey's avatar
      softwrap: remove and replace workarounds for firstcolumn · e52d5b06
      David Lawrence Ramsey authored
      Actually enable scrolling edittop partially off the screen by making
      edit_scroll() and adjust_viewport() use firstcolumn properly when
      iterating through softwrapped chunks in softwrap mode, or lines in
      non-softwrap mode.
      
      In non-softwrap mode, firstcolumn should still always be zero, because
      it's initially set to that, and because passing it through the iterators
      will maintain it at that.
      
      This fixes https://savannah.gnu.org/bugs/?49100
      
      .
      Reported-by: default avatarDavid Lawrence Ramsey <pooka109@gmail.com>
      e52d5b06
    • David Lawrence Ramsey's avatar
      weeding: remove maxlines and related code · 812ecaeb
      David Lawrence Ramsey authored
      Since all lines can be partially scrolled off the screen now
      (except for edittop, which is forthcoming), the maxlines global
      variable and its computation mechanism are no longer needed.
      812ecaeb
    • David Lawrence Ramsey's avatar
      softwrap: iterate through softwrapped chunks in adjust_viewport() · 2abf7b75
      David Lawrence Ramsey authored
      Use go_back_chunks() to adjust edittop, instead of special casing
      the computation of goal when softwrapping.  Now softwrap mode and
      non-softwrap mode will behave the same way when edittop can be
      partially scrolled 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.)
      2abf7b75
    • 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 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 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: 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