Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RubAbstractTextArea: Avoid a superfluous isNotNil in handleEdit: #11645

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 16 additions & 15 deletions src/Rubric/RubAbstractTextArea.class.st
Expand Up @@ -974,6 +974,20 @@ RubAbstractTextArea >> grabbedAllowed [
^ scrollPane isNil
]

{ #category : #accessing }
RubAbstractTextArea >> grow [
"Answer whether the area should grow horizontally."

^ grow
]

{ #category : #accessing }
RubAbstractTextArea >> grow: aBool [
"Set whether the area should grow horizontally."

grow := aBool
]

{ #category : #geometry }
RubAbstractTextArea >> handleBoundsChange: aBlock [
| oldBounds |
Expand All @@ -993,7 +1007,7 @@ RubAbstractTextArea >> handleEdit: editBlock [

editBlock value.
"Fit to width on edit"
(self grow isNotNil & self grow) ifTrue: [
grow ifTrue: [
self width: (1 max: self maxLineWidth + self margins left + self margins right)
].
self selectionChanged "Note new selection"
Expand Down Expand Up @@ -1144,6 +1158,7 @@ RubAbstractTextArea >> highlightMessageSend [
{ #category : #initialization }
RubAbstractTextArea >> initialize [
super initialize.
grow := false.
self compose.
self addCursor.
self plugFindReplace.
Expand Down Expand Up @@ -1307,20 +1322,6 @@ RubAbstractTextArea >> maxLength: anInteger [
maxLength := anInteger max: 0
]

{ #category : #accessing }
RubAbstractTextArea >> grow [
"Answer whether the area should grow horizontally."

^ grow
]

{ #category : #accessing }
RubAbstractTextArea >> grow: aBool [
"Set whether the area should grow horizontally."

grow := aBool
]

{ #category : #measuring }
RubAbstractTextArea >> maxLineWidth [
"Answers with the maximum approximate pixel width across all lines"
Expand Down