Ticket #3245: mc-3245-line-number-off-by-one.patch

File mc-3245-line-number-off-by-one.patch, 516 bytes (added by egmont, 6 years ago)

Make line numbers 1-based

  • src/viewer/dialogs.c

    diff --git a/src/viewer/dialogs.c b/src/viewer/dialogs.c
    index b93fc18..44521cb 100644
    a b mcview_dialog_goto (mcview_t * view, off_t * offset) 
    238238            switch (current_goto_type) 
    239239            { 
    240240            case MC_VIEW_GOTO_LINENUM: 
     241                if (addr > 0) 
     242                    addr--; 
    241243                mcview_coord_to_offset (view, offset, addr, 0); 
    242244                *offset = mcview_bol (view, *offset, 0); 
    243245                break;