Skip to content

Commit

Permalink
Fixes #138: persistent follow mode persisting too well
Browse files Browse the repository at this point in the history
  • Loading branch information
mason-larobina committed Oct 2, 2012
1 parent fc4b144 commit 514819e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/follow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ local function follow(w)
local ret, err = view:eval_js(evaluator, d)
assert(not err, err)

if state.persist then
if mode.persist then
w:set_mode("follow", mode)
else
w:set_mode()
Expand Down Expand Up @@ -548,7 +548,7 @@ local function follow_all_hints(w)
local ret, err = view:eval_js(evaluator, d)
assert(not err, err)

if state.persist then
if mode.persist then
w:set_mode("follow", mode)
else
w:set_mode()
Expand Down Expand Up @@ -587,15 +587,16 @@ new_mode("follow", {
local view = w.view
local all_frames, frames = view.frames, {}

local state = {
if w.follow_persist then
mode.persist = true
w.follow_persist = nil
end

w.follow_state = {
mode = mode, view = view, frames = frames,
evaluator = evaluator,
persist = not not w.follow_persist
}

w.follow_state = state
w.follow_persist = state.persist

local init_js = string.format([=[luakit_follow.init(%q, %q)]=],
selector, stylesheet)

Expand Down

1 comment on commit 514819e

@Plaque-fcc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruining the success of persistence… I like that! ;D

Please sign in to comment.