Use current view for every action

Fixes #1015
This commit is contained in:
Zachary Yedidia
2018-02-02 12:33:13 -05:00
parent 3e3cdfc5b5
commit 35a9245c5d

View File

@@ -525,7 +525,8 @@ func (v *View) ExecuteActions(actions []func(*View, bool) bool) bool {
for _, action := range actions {
readonlyBindingsResult := false
funcName := ShortFuncName(action)
if v.Type.Readonly == true {
curv := CurView()
if curv.Type.Readonly == true {
// check for readonly and if true only let key bindings get called if they do not change the contents.
for _, readonlyBindings := range readonlyBindingsList {
if strings.Contains(funcName, readonlyBindings) {
@@ -535,7 +536,7 @@ func (v *View) ExecuteActions(actions []func(*View, bool) bool) bool {
}
if !readonlyBindingsResult {
// call the key binding
relocate = action(v, true) || relocate
relocate = action(curv, true) || relocate
// Macro
if funcName != "ToggleMacro" && funcName != "PlayMacro" {
if recordingMacro {