added history options (#866)

* added history options

* sorry forgot to update docs
This commit is contained in:
segf00lt authored and GitHub committed 2022-07-10 15:32:34 +03:00
1 parent aee5c3371f
commit da2d8a2979
6 files changed
+15 -2

No files matched your search

+4 -2
View File
@@ -59,8 +59,10 @@ func newApp(ui *ui, nav *nav) *app {
}
func (app *app) quit() {
if err := app.writeHistory(); err != nil {
log.Printf("writing history file: %s", err)
if gOpts.history {
if err := app.writeHistory(); err != nil {
log.Printf("writing history file: %s", err)
}
}
if !gSingleMode {
if err := remote(fmt.Sprintf("drop %d", gClientID)); err != nil {
+1
View File
@@ -124,6 +124,7 @@ The following options can be used to customize the behavior of lf:
globsearch bool (default off)
hidden bool (default off)
hiddenfiles []string (default '.*')
history bool (default on)
icons bool (default off)
ifs string (default '')
ignorecase bool (default on)
+1
View File
@@ -128,6 +128,7 @@ The following options can be used to customize the behavior of lf:
globsearch bool (default off)
hidden bool (default off)
hiddenfiles []string (default '.*')
history bool (default on)
icons bool (default off)
ifs string (default '')
ignorecase bool (default on)
+6
View File
@@ -125,6 +125,12 @@ func (e *setExpr) eval(app *app, args []string) {
app.nav.position()
app.ui.sort()
app.ui.loadFile(app.nav, true)
case "history":
gOpts.history = true
case "nohistory":
gOpts.history = false
case "history!":
gOpts.history = !gOpts.history
case "icons":
gOpts.icons = true
case "noicons":
+1
View File
@@ -143,6 +143,7 @@ The following options can be used to customize the behavior of lf:
globsearch bool (default off)
hidden bool (default off)
hiddenfiles []string (default '.*')
history bool (default on)
icons bool (default off)
ifs string (default '')
ignorecase bool (default on)
+2
View File
@@ -67,6 +67,7 @@ var gOpts struct {
truncatechar string
ratios []int
hiddenfiles []string
history bool
info []string
shellopts []string
keys map[string]expr
@@ -117,6 +118,7 @@ func init() {
gOpts.truncatechar = "~"
gOpts.ratios = []int{1, 2, 3}
gOpts.hiddenfiles = []string{".*"}
gOpts.history = true
gOpts.info = nil
gOpts.shellopts = nil
gOpts.sortType = sortType{naturalSort, dirfirstSort}