CodeView.st
author Claus Gittinger <cg@exept.de>
Fri, 24 Nov 1995 10:13:25 +0100
changeset 206 2363a64a7c88
parent 201 d2888811c664
child 274 6df4bb990f04
permissions -rw-r--r--
version at the end
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
4
88eb91574867 *** empty log message ***
claus
parents: 2
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
70
14443a9ea4ec *** empty log message ***
claus
parents: 59
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    13
Workspace subclass:#CodeView
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    14
	 instanceVariableNames:'explainAction'
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    15
	 classVariableNames:''
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    16
	 poolDictionaries:''
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    17
	 category:'Interface-Workspace'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    18
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    19
32
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
    20
!CodeView class methodsFor:'documentation'!
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
    21
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    22
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    23
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    24
 COPYRIGHT (c) 1989 by Claus Gittinger
70
14443a9ea4ec *** empty log message ***
claus
parents: 59
diff changeset
    25
	      All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    26
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    27
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    28
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    30
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    31
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    32
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    33
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    34
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    35
32
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
    36
documentation
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
    37
"
125
claus
parents: 123
diff changeset
    38
    a view for text which is known to be smalltalk code. 
claus
parents: 123
diff changeset
    39
    It adds explain to the menu, and defines another action: 
claus
parents: 123
diff changeset
    40
      explainAction to be performed for explain.
32
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
    41
125
claus
parents: 123
diff changeset
    42
    This action is to be defined by the user of this view 
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    43
    (i.e. ususally the owning browser)
121
claus
parents: 118
diff changeset
    44
125
claus
parents: 123
diff changeset
    45
    If used with a model, accept sends the changeMsg to it (as defined in EditTextView).
121
claus
parents: 118
diff changeset
    46
    (however, it is possible to define moth changeMsg and acceptAction)
123
claus
parents: 121
diff changeset
    47
claus
parents: 121
diff changeset
    48
claus
parents: 121
diff changeset
    49
    Caveat:
claus
parents: 121
diff changeset
    50
	in this version, CodeView does not yet support MVC setups for doIt
claus
parents: 121
diff changeset
    51
	and explain.
claus
parents: 121
diff changeset
    52
	If required, simulate this by setting the doItAction and
claus
parents: 121
diff changeset
    53
	explainAction, to notify the model manually about whats going on.
32
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
    54
"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    55
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    56
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    57
!CodeView methodsFor:'accessing'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    58
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    59
explainAction:aBlock
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    60
    "set the action to be performed on explain"
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    61
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    62
    explainAction := aBlock
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    63
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    64
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    65
!CodeView methodsFor:'editing'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    66
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    67
commentFrom:line1 to:line2
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    68
    "convenient function to comment out a block.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    69
     All lines from line1 to line2 get an end-of-line comment
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    70
     in the first col."
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    71
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    72
    line1 to:line2 do:[:lineNr |
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    73
	|l|
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    74
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    75
	l := self listAt:lineNr.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    76
	l isNil ifTrue:[l := ''].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    77
	self at:lineNr put:(('"' , '/') , l)
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    78
    ].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    79
    self textChanged.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    80
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    81
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    82
uncommentFrom:line1 to:line2
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    83
    "convenient function to comment out a block.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    84
     All lines from line1 to line2 get an end-of-line comment
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    85
     in the first col."
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    86
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    87
    line1 to:line2 do:[:lineNr |
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    88
	|l|
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    89
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    90
	l := self listAt:lineNr.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    91
	(l notNil and:[l startsWith:('"' ,'/')]) ifTrue:[
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    92
	    self at:lineNr put:(l copyFrom:3)
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    93
	]
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    94
    ].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    95
    self textChanged.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    96
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    97
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    98
!CodeView methodsFor:'event handling'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    99
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   100
keyPress:key x:x y:y
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   101
    "catch keyboard shortcuts"
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   102
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   103
    <resource: #keyboard (#Accept #Explain #Help 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   104
	       #CommentSelection #UncommentSelection)>
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   105
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   106
    (key == #Accept)  ifTrue:[^ self accept].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   107
    (key == #Explain) ifTrue:[^ self explain].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   108
    (key == #Help)    ifTrue:[^ self explain].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   109
    (key == #CommentSelection)    ifTrue:[^ self commentSelection].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   110
    (key == #UncommentSelection)  ifTrue:[^ self uncommentSelection].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   111
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   112
    super keyPress:key x:x y:y
32
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
   113
! !
b6c23dfd5663 *** empty log message ***
claus
parents: 27
diff changeset
   114
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   115
!CodeView methodsFor:'initialization'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   116
97
cbf495fe3b64 *** empty log message ***
claus
parents: 95
diff changeset
   117
editMenu
121
claus
parents: 118
diff changeset
   118
    "return the popUpMenu;
claus
parents: 118
diff changeset
   119
     to make this independent from what is defined in superclasses,
claus
parents: 118
diff changeset
   120
     get the superclass menu and add my functions."
131
claus
parents: 125
diff changeset
   121
97
cbf495fe3b64 *** empty log message ***
claus
parents: 95
diff changeset
   122
    |m sub idx|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   123
97
cbf495fe3b64 *** empty log message ***
claus
parents: 95
diff changeset
   124
    m := super editMenu.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   125
131
claus
parents: 125
diff changeset
   126
    self sensor ctrlDown ifTrue:[
claus
parents: 125
diff changeset
   127
	m addLabels:(resources array:#('-' 'commentIt' 'uncommentIt'))
claus
parents: 125
diff changeset
   128
	  selectors:#(nil commentSelection uncommentSelection)
claus
parents: 125
diff changeset
   129
	  after:(m labels size).
claus
parents: 125
diff changeset
   130
	self hasSelection ifFalse:[
claus
parents: 125
diff changeset
   131
	    m disableAll:#(commentSelection uncommentSelection) 
claus
parents: 125
diff changeset
   132
	].
claus
parents: 125
diff changeset
   133
    ] ifFalse:[
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   134
131
claus
parents: 125
diff changeset
   135
	"
claus
parents: 125
diff changeset
   136
	 codeViews do support #accept
claus
parents: 125
diff changeset
   137
	 ... add it after #inspectIt
claus
parents: 125
diff changeset
   138
	"
claus
parents: 125
diff changeset
   139
	idx := m indexOf:#inspectIt.
claus
parents: 125
diff changeset
   140
	idx ~~ 0 ifTrue:[
claus
parents: 125
diff changeset
   141
	    m addLabels:(resources array:#('-' 'accept'))
claus
parents: 125
diff changeset
   142
	      selectors:#(nil accept)
claus
parents: 125
diff changeset
   143
	      after:idx.
claus
parents: 125
diff changeset
   144
	].
claus
parents: 125
diff changeset
   145
claus
parents: 125
diff changeset
   146
	"
claus
parents: 125
diff changeset
   147
	 and add #explain after $gotoLine in the extra menu
claus
parents: 125
diff changeset
   148
	"
claus
parents: 125
diff changeset
   149
	sub := m subMenuAt:#others.
claus
parents: 125
diff changeset
   150
	sub notNil ifTrue:[
claus
parents: 125
diff changeset
   151
	    idx := sub indexOf:#gotoLine.
claus
parents: 125
diff changeset
   152
	    sub addLabels:(resources array:#('-' 'explain'))
claus
parents: 125
diff changeset
   153
		selectors:#(nil explain)
claus
parents: 125
diff changeset
   154
		after:idx.
claus
parents: 125
diff changeset
   155
	    self hasSelection ifFalse:[
claus
parents: 125
diff changeset
   156
		sub disable:#explain 
claus
parents: 125
diff changeset
   157
	    ].
97
cbf495fe3b64 *** empty log message ***
claus
parents: 95
diff changeset
   158
	].
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   159
    ].
131
claus
parents: 125
diff changeset
   160
    ^ m.
claus
parents: 125
diff changeset
   161
! !
97
cbf495fe3b64 *** empty log message ***
claus
parents: 95
diff changeset
   162
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   163
!CodeView methodsFor:'user actions'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   164
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   165
accept
125
claus
parents: 123
diff changeset
   166
    "redefined accept action;
claus
parents: 123
diff changeset
   167
     save cursor and selection to allow restore in case of an error
claus
parents: 123
diff changeset
   168
     (we are typically compiling here ... and the compiler may show
claus
parents: 123
diff changeset
   169
     errors by highlighting them)"
95
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   170
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   171
    codeStartPosition := 1.
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   172
    [
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   173
	Object abortSignal handle:[:ex |
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   174
	    self cursor:Cursor normal.
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   175
	    "redraw selection in normal color"
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   176
	    self selectFromLine:selectionStartLine col:selectionStartCol 
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   177
			 toLine:selectionEndLine col:selectionEndCol.
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   178
	    ex return
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   179
	] do:[
125
claus
parents: 123
diff changeset
   180
	    super accept.
70
14443a9ea4ec *** empty log message ***
claus
parents: 59
diff changeset
   181
	]
95
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   182
    ] valueNowOrOnUnwindDo:[
7535cfca9509 *** empty log message ***
claus
parents: 70
diff changeset
   183
	self unselect.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   184
    ]
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   185
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   186
136
claus
parents: 132
diff changeset
   187
commentSelection
claus
parents: 132
diff changeset
   188
    "convenient function to comment out a block.
claus
parents: 132
diff changeset
   189
     All lines from line1 to line2 get an end-of-line comment
claus
parents: 132
diff changeset
   190
     in the first col."
claus
parents: 132
diff changeset
   191
claus
parents: 132
diff changeset
   192
    |e|
claus
parents: 132
diff changeset
   193
claus
parents: 132
diff changeset
   194
    (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
claus
parents: 132
diff changeset
   195
	self commentFrom:selectionStartLine to:selectionEndLine-1
claus
parents: 132
diff changeset
   196
    ] ifFalse:[
claus
parents: 132
diff changeset
   197
	self insert:$" atLine:selectionStartLine col:selectionStartCol.
claus
parents: 132
diff changeset
   198
	e := selectionEndCol + 1.
claus
parents: 132
diff changeset
   199
	selectionStartLine == selectionEndLine ifTrue:[e := e + 1].
claus
parents: 132
diff changeset
   200
	self insert:$" atLine:selectionEndLine col:e.
claus
parents: 132
diff changeset
   201
	self selectFromLine:selectionStartLine col:selectionStartCol
claus
parents: 132
diff changeset
   202
		     toLine:selectionEndLine col:e.
claus
parents: 132
diff changeset
   203
    ]
claus
parents: 132
diff changeset
   204
!
claus
parents: 132
diff changeset
   205
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   206
explain
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   207
    "explain action;
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   208
     evaluate the explainBlock passing whole contents and 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   209
     selection as arguments."
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   210
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   211
    |text|
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   212
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   213
    explainAction notNil ifTrue:[
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   214
	text := self selection.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   215
	text notNil ifTrue:[
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   216
	    explainAction value:(self contents) value:(text asString)
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   217
	]
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   218
    ]
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   219
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   220
136
claus
parents: 132
diff changeset
   221
uncommentSelection
claus
parents: 132
diff changeset
   222
    "convenient function to comment out a block.
claus
parents: 132
diff changeset
   223
     All lines from line1 to line2 get an end-of-line comment
claus
parents: 132
diff changeset
   224
     in the first col."
claus
parents: 132
diff changeset
   225
claus
parents: 132
diff changeset
   226
    |e|
claus
parents: 132
diff changeset
   227
claus
parents: 132
diff changeset
   228
    (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
claus
parents: 132
diff changeset
   229
	self uncommentFrom:selectionStartLine to:selectionEndLine-1
claus
parents: 132
diff changeset
   230
    ] ifFalse:[
claus
parents: 132
diff changeset
   231
	((self characterAtLine:selectionStartLine col:selectionStartCol) == $"
claus
parents: 132
diff changeset
   232
	and:[(self characterAtLine:selectionEndLine col:selectionEndCol) == $"]) ifTrue:[
claus
parents: 132
diff changeset
   233
	    self deleteCharAtLine:selectionEndLine col:selectionEndCol.
claus
parents: 132
diff changeset
   234
	    self deleteCharAtLine:selectionStartLine col:selectionStartCol.
claus
parents: 132
diff changeset
   235
	    e := selectionEndCol - 1.
claus
parents: 132
diff changeset
   236
	    selectionStartLine == selectionEndLine ifTrue:[e := e - 1].
claus
parents: 132
diff changeset
   237
	    self selectFromLine:selectionStartLine col:selectionStartCol
claus
parents: 132
diff changeset
   238
			 toLine:selectionEndLine col:e.
claus
parents: 132
diff changeset
   239
	]
claus
parents: 132
diff changeset
   240
    ]
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   241
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   242
206
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   243
!CodeView class methodsFor:'documentation'!
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   244
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   245
version
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   246
    ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.23 1995-11-24 09:13:18 cg Exp $'
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   247
! !