Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Overscroll after set drawbox when started with set nodrawbox #2209

@CatsDeservePets

Description

@CatsDeservePets

Description

When drawbox is set to false initially and later enabled at runtime with :set drawbox, the file list can scroll past the bottom of the screen.
This doesn't happen when starting lf with drawbox already enabled.

This bug was introduced in

by this change:

diff --git a/eval.go b/eval.go
index 709cc34..d8c10c1 100644
--- a/eval.go
+++ b/eval.go
@@ -92,10 +92,7 @@ func (e *setExpr) eval(app *app, args []string) {
        err = applyBoolOpt(&gOpts.drawbox, e)
        if err == nil {
            app.ui.renew()
-           if app.nav.height != app.ui.wins[0].h {
-               app.nav.height = app.ui.wins[0].h
-               clear(app.nav.regCache)
-           }
+           clear(app.nav.regCache)
            app.ui.loadFile(app, true)
        }
    case "hidden", "nohidden", "hidden!":
aba7388 13da770

Steps to reproduce:

  • Make sure drawbox is disabled inside your lfrc:
set nodrawbox
  • Use lf to go inside a directory that has more files than can fit on the current screen
  • Type :set drawbox
  • Scroll down till you reach the end of the currently shown files (you can also use wrapscroll or just press G)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions