Spec icon indicating copy to clipboard operation
Spec copied to clipboard

Double execution when use bindkey...

Open Ducasse opened this issue 8 months ago • 0 comments

We created a simple way to reproduce the problem

#( 'Microdown'  ) do: [ :name |
		(IceRepository repositoryNamed: name)
			ifNil: [ self inform: 'Project not found: ' , name ]
			ifNotNil: [ :found |
				found
					unload;
					forget ] ].
		Smalltalk globals 
			at: #BaselineOfMicrodown 
			ifPresent: [ :c | c removeFromSystem ].



Metacello new	
	baseline: 'TheNoteTaker';	
	repository: 'github://hernanmd/the-note-taker/src';	
	load.

load hash Commit d4b4f37

initializePresenters
	"in initialize it is called after so defeat textInputText: logic"

	composer := MicRichTextComposer new.

	textInput := self newText.
	textInput
		bindKeyCombination: Character space asKeyCombination | Character cr asKeyCombination 
		toAction: [ :target :morph :event |
				Transcript show: '#'.
				self renderDocument.
				event wasHandled: false ].
			
	textInput eventHandler whenKeyDownDo: [ :anEvent |
			isTextDirty := true.
			anEvent wasHandled: false ].

	renderedText := self newText
		                beNotEditable;
		                yourself.
	textInput
		whenTextChangedDo: [
				note ifNotNil: [ note contents: textInput text asString ] ];
		bindKeyCombination: $s meta 
		toAction: [ self saveFile . self inform: 'Note ' , note fileReference fullName , ' saved' ];
		bindKeyCombination: $g meta 
		toAction: [ self push . self inform: 'Folder push' ]

When we type one space we get two execution --- # on the transcript.

Ducasse avatar Jun 12 '25 13:06 Ducasse