Check for readonly on viewtype and if true do not let any edits or paste to buffer. eg help and plugins. Finished needs checking. (#674)

* corrected spelling error and missing public function comments

* check for readonly and if true do not insert character

* mouse middle  click checks for view type readonly and does not paste if view is readonly

* check for view readonly with binding keys and if readonly do not change the content.
This commit is contained in:
Tommy
2017-05-29 19:18:10 +01:00
committed by Zachary Yedidia
parent 89863660ba
commit 4644a2b5cc
3 changed files with 61 additions and 33 deletions

View File

@@ -267,11 +267,16 @@ func Abs(n int) int {
return n
}
// FuncName returns the name of a given function object
// FuncName returns the full name of a given function object
func FuncName(i interface{}) string {
return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
}
// ShortFuncName returns the name only of a given function object
func ShortFuncName(i interface{}) string {
return strings.TrimPrefix(runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name(), "main.(*View).")
}
// SplitCommandArgs separates multiple command arguments which may be quoted.
// The returned slice contains at least one string
func SplitCommandArgs(input string) []string {