mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 17:50:15 +09:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user