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

@@ -11,11 +11,11 @@ import (
const (
// Opposite and undoing events must have opposite values
// TextEventInsert repreasents an insertion event
// TextEventInsert represents an insertion event
TextEventInsert = 1
// TextEventRemove represents a deletion event
TextEventRemove = -1
// TextEventReplace represents a replace event
TextEventReplace = 0
)
@@ -117,7 +117,7 @@ func (eh *EventHandler) Remove(start, end Loc) {
eh.Execute(e)
}
// Multiple creates an multiple insertions executes them
// MultipleReplace creates an multiple insertions executes them
func (eh *EventHandler) MultipleReplace(deltas []Delta) {
e := &TextEvent{
C: eh.buf.Cursor,