EditTextView.st
changeset 3580 c9d10df2b8bc
parent 3578 9d43beca1e85
child 3583 fd5a924c8681
equal deleted inserted replaced
3579:3923810267b6 3580:c9d10df2b8bc
  6265 
  6265 
  6266     pos := self startPositionForSearchBackward.
  6266     pos := self startPositionForSearchBackward.
  6267     startLine := pos y.
  6267     startLine := pos y.
  6268     startCol := pos x.
  6268     startCol := pos x.
  6269 
  6269 
       
  6270     self searchBwd:pattern ignoreCase:ign startingAtLine:startLine col:startCol ifAbsent:aBlock
       
  6271 
       
  6272     "Modified: 9.10.1997 / 13:02:13 / cg"
       
  6273 !
       
  6274 
       
  6275 searchBwd:pattern ignoreCase:ign startingAtLine:startLine col:startCol ifAbsent:aBlock
       
  6276     "do a backward search"
       
  6277 
       
  6278     cursorLine isNil ifTrue:[^ self].
       
  6279 
  6270     self
  6280     self
  6271 	searchBackwardFor:pattern
  6281         searchBackwardFor:pattern
  6272 	ignoreCase:ign
  6282         ignoreCase:ign
  6273 	startingAtLine:startLine col:startCol
  6283         startingAtLine:startLine col:startCol
  6274 	ifFound:[:line :col |
  6284         ifFound:[:line :col |
  6275 	    self cursorMovementAllowed ifTrue:[
  6285             self cursorMovementAllowed ifTrue:[
  6276 		self cursorLine:line col:col.
  6286                 self cursorLine:line col:col.
  6277 	    ].
  6287             ].
  6278 	    self showMatch:pattern atLine:line col:col.
  6288             self showMatch:pattern atLine:line col:col.
  6279 "/            self makeLineVisible:cursorLine
  6289 "/            self makeLineVisible:cursorLine
  6280 	    typeOfSelection := #search]
  6290             typeOfSelection := #search]
  6281 	ifAbsent:aBlock
  6291         ifAbsent:aBlock
  6282 
  6292 
  6283     "Modified: 9.10.1997 / 13:02:13 / cg"
  6293     "Modified: 9.10.1997 / 13:02:13 / cg"
  6284 !
  6294 !
  6285 
  6295 
  6286 searchForAndSelectMatchingParenthesis
  6296 searchForAndSelectMatchingParenthesis
  6593 
  6603 
  6594 selectWordUnderCursor
  6604 selectWordUnderCursor
  6595     "select the word under the cursor"
  6605     "select the word under the cursor"
  6596 
  6606 
  6597     self selectWordAtLine:cursorLine col:cursorCol
  6607     self selectWordAtLine:cursorLine col:cursorCol
       
  6608 !
       
  6609 
       
  6610 selectionForStringSearchTool
       
  6611 
       
  6612     |sel searchPattern|
       
  6613 
       
  6614     "/
       
  6615     "/ if there is a selection:
       
  6616     "/    if there was no previous search, take it as search pattern.
       
  6617     "/    if there was a previous search, only take the selection if
       
  6618     "/    it did not result from a paste.
       
  6619     "/    (to allow search-paste to be repeated)
       
  6620     "/
       
  6621 
       
  6622     sel := self selection.
       
  6623     sel notNil ifTrue:[
       
  6624         typeOfSelection ~~ #search ifTrue:[
       
  6625             typeOfSelection ~~ #paste ifTrue:[
       
  6626                 self cursorLine:selectionStartLine col:selectionStartCol.
       
  6627                 searchPattern := sel asStringWithoutFinalCR.
       
  6628             ]
       
  6629         ]
       
  6630     ].
       
  6631     ^ searchPattern
  6598 !
  6632 !
  6599 
  6633 
  6600 unselect
  6634 unselect
  6601     "forget and unhilight selection - must take care of cursor here"
  6635     "forget and unhilight selection - must take care of cursor here"
  6602 
  6636 
  7228 ! !
  7262 ! !
  7229 
  7263 
  7230 !EditTextView class methodsFor:'documentation'!
  7264 !EditTextView class methodsFor:'documentation'!
  7231 
  7265 
  7232 version
  7266 version
  7233     ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.428 2008-04-02 11:58:41 fm Exp $'
  7267     ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.429 2008-04-04 16:26:13 fm Exp $'
  7234 ! !
  7268 ! !