Ticket #3943: 3943_2.patch

File 3943_2.patch, 895 bytes (added by andrew_b, 6 years ago)
  • src/filemanager/panel.c

    diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
    index c653b82..db6ce0c 100644
    a b adjust_top_file (WPanel * panel) 
    13491349{ 
    13501350    int items; 
    13511351 
     1352    panel->selected = CLAMP (panel->selected, 0, panel->dir.len - 1); 
     1353 
    13521354    items = panel_items (panel); 
    13531355 
    13541356    if (panel->dir.len <= items) 
    set_panel_formats (WPanel * p) 
    44984500void 
    44994501select_item (WPanel * panel) 
    45004502{ 
    4501     /* Although currently all over the code we set the selection and 
    4502        top file to decent values before calling select_item, I could 
    4503        forget it someday, so it's better to do the actual fitting here */ 
    4504  
    4505     if (panel->selected < 0) 
    4506         panel->selected = 0; 
    4507  
    4508     if (panel->selected > panel->dir.len - 1) 
    4509         panel->selected = panel->dir.len - 1; 
    4510  
    45114503    adjust_top_file (panel); 
    45124504 
    45134505    panel->dirty = 1;