30 SimpleView subclass:#CodeView2 |
30 SimpleView subclass:#CodeView2 |
31 instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder |
31 instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder |
32 classHolder browserHolder codeAspect modifiedChannel |
32 classHolder browserHolder codeAspect modifiedChannel |
33 showGutterChannel showAcceptCancelBarChannel modeHolder |
33 showGutterChannel showAcceptCancelBarChannel modeHolder |
34 serviceManager services servicesFromClient syntaxElements |
34 serviceManager services servicesFromClient syntaxElements |
|
35 currentParseNodeHolder currentBlockNodeHolder |
35 syntaxElementSelection highlightEmphasis diffMode |
36 syntaxElementSelection highlightEmphasis diffMode |
36 synchronizedCodeViews' |
37 synchronizedCodeViews' |
37 classVariableNames:'TraceSelectors' |
38 classVariableNames:'TraceSelectors' |
38 poolDictionaries:'' |
39 poolDictionaries:'' |
39 category:'Interface-CodeView' |
40 category:'Interface-CodeView' |
40 ! |
41 ! |
41 |
42 |
42 SimpleView subclass:#GutterView |
43 SimpleView subclass:#GutterView |
43 instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel |
44 instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel |
44 widthAnnotations widthDiffInfo numberOfLines acceptColor |
45 widthAnnotations widthDiffInfo numberOfLines acceptColor |
45 cancelColor diffColor menuHolder showLineNumbers' |
46 cancelColor diffColor menuHolder currentBlockNodeHolder |
|
47 showLineNumbers' |
46 classVariableNames:'' |
48 classVariableNames:'' |
47 poolDictionaries:'' |
49 poolDictionaries:'' |
48 privateIn:CodeView2 |
50 privateIn:CodeView2 |
49 ! |
51 ! |
50 |
52 |
220 (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp |
222 (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp |
221 " |
223 " |
222 |
224 |
223 <resource: #menu> |
225 <resource: #menu> |
224 |
226 |
225 ^ |
227 ^ |
226 #(Menu |
228 #(Menu |
227 ( |
229 ( |
228 (MenuItem |
230 (MenuItem |
229 label: 'Implementors...' |
231 label: 'Implementors...' |
230 itemValue: browseImplementorsOfIt |
232 itemValue: browseImplementorsOfIt |
231 translateLabel: true |
233 submenuChannel: implementorsMenu |
232 submenuChannel: implementorsMenu |
234 shortcutKey: ImplementorsOfIt |
233 shortcutKey: ImplementorsOfIt |
235 ) |
234 ) |
236 (MenuItem |
235 (MenuItem |
237 label: 'Senders...' |
236 label: 'Senders...' |
238 itemValue: browseSendersOfIt |
237 itemValue: browseSendersOfIt |
239 submenuChannel: sendersMenu |
238 translateLabel: true |
240 shortcutKey: SendersOfIt |
239 submenuChannel: sendersMenu |
241 ) |
240 shortcutKey: SendersOfIt |
242 (MenuItem |
241 ) |
243 label: 'Refactor' |
242 (MenuItem |
244 nameKey: refactor |
243 label: 'Refactor' |
245 isVisible: false |
244 nameKey: refactor |
246 shortcutKey: Shift |
245 translateLabel: true |
247 ) |
246 isVisible: false |
248 (MenuItem |
247 shortcutKey: Shift |
249 label: '-' |
248 ) |
250 ) |
249 (MenuItem |
251 (MenuItem |
250 label: '-' |
252 label: 'Accept' |
251 ) |
253 itemValue: accept |
252 (MenuItem |
254 shortcutKey: Accept |
253 label: 'Accept' |
255 ) |
254 itemValue: accept |
256 (MenuItem |
255 translateLabel: true |
257 label: '-' |
256 shortcutKey: Accept |
258 ) |
257 ) |
259 (MenuItem |
258 (MenuItem |
260 label: 'Cut' |
259 label: '-' |
261 itemValue: cut |
260 ) |
262 shortcutKey: Cut |
261 (MenuItem |
263 ) |
262 label: 'Cut' |
264 (MenuItem |
263 itemValue: cut |
265 label: 'Copy' |
264 translateLabel: true |
266 itemValue: copySelection |
265 shortcutKey: Cut |
267 shortcutKey: Copy |
266 ) |
268 ) |
267 (MenuItem |
269 (MenuItem |
268 label: 'Copy' |
270 label: 'Paste' |
269 itemValue: copySelection |
271 itemValue: pasteOrReplace |
270 translateLabel: true |
272 shortcutKey: Paste |
271 shortcutKey: Copy |
273 ) |
272 ) |
274 (MenuItem |
273 (MenuItem |
275 label: '-' |
274 label: 'Paste' |
276 ) |
275 itemValue: pasteOrReplace |
277 (MenuItem |
276 translateLabel: true |
278 label: 'Undo' |
277 shortcutKey: Paste |
279 itemValue: undo |
278 ) |
280 shortcutKey: Undo |
279 (MenuItem |
281 ) |
280 label: '-' |
282 (MenuItem |
281 ) |
283 label: 'Redo' |
282 (MenuItem |
284 itemValue: redo |
283 label: 'Undo' |
285 shortcutKey: Redo |
284 itemValue: undo |
286 ) |
285 translateLabel: true |
287 (MenuItem |
286 shortcutKey: Undo |
288 label: '-' |
287 ) |
289 ) |
288 (MenuItem |
290 (MenuItem |
289 label: '-' |
291 label: 'Do it' |
290 ) |
292 itemValue: doIt |
291 (MenuItem |
293 shortcutKey: DoIt |
292 label: 'Do it' |
294 ) |
293 itemValue: doIt |
295 (MenuItem |
294 translateLabel: true |
296 label: 'Print it' |
295 shortcutKey: DoIt |
297 itemValue: printIt |
296 ) |
298 shortcutKey: PrintIt |
297 (MenuItem |
299 ) |
298 label: 'Print it' |
300 (MenuItem |
299 itemValue: printIt |
301 label: 'Inspect it' |
300 translateLabel: true |
302 itemValue: inspectIt |
301 shortcutKey: PrintIt |
303 shortcutKey: InspectIt |
302 ) |
304 ) |
303 (MenuItem |
305 (MenuItem |
304 label: 'Inspect it' |
306 label: 'Profile it' |
305 itemValue: inspectIt |
307 itemValue: profileIt |
306 translateLabel: true |
308 shortcutKey: InspectIt |
307 shortcutKey: InspectIt |
309 ) |
308 ) |
310 (MenuItem |
309 (MenuItem |
311 label: '-' |
310 label: 'Profile it' |
312 ) |
311 itemValue: profileIt |
313 (MenuItem |
312 translateLabel: true |
314 label: 'Show Gutter' |
313 shortcutKey: InspectIt |
315 nameKey: ShowGutter |
314 ) |
316 indication: showGutterChannel |
315 (MenuItem |
317 ) |
316 label: '-' |
318 (MenuItem |
317 ) |
319 label: 'More' |
318 (MenuItem |
320 nameKey: More |
319 label: 'Show Gutter' |
321 ) |
320 nameKey: ShowGutter |
322 (MenuItem |
321 translateLabel: true |
323 label: 'Services' |
322 indication: showGutterChannel |
324 submenuChannel: servicesMenu |
323 ) |
325 ) |
324 (MenuItem |
326 (MenuItem |
325 label: 'More' |
327 label: 'Debug' |
326 nameKey: More |
328 submenuChannel: debugMenu |
327 translateLabel: true |
329 ) |
328 ) |
330 ) |
329 (MenuItem |
331 nil |
330 label: 'Services' |
332 nil |
331 translateLabel: true |
|
332 submenuChannel: servicesMenu |
|
333 ) |
|
334 (MenuItem |
|
335 label: 'Debug' |
|
336 translateLabel: true |
|
337 submenuChannel: debugMenu |
|
338 ) |
|
339 ) |
|
340 nil |
|
341 nil |
|
342 ) |
333 ) |
343 |
|
344 "Modified: / 08-03-2012 / 12:36:18 / cg" |
|
345 ! |
334 ! |
346 |
335 |
347 editMenu_stxStyle |
336 editMenu_stxStyle |
348 "This resource specification was automatically generated |
337 "This resource specification was automatically generated |
349 by the MenuEditor of ST/X." |
338 by the MenuEditor of ST/X." |
577 model: aValueModel |
613 model: aValueModel |
578 |
614 |
579 |oldValue newValue| |
615 |oldValue newValue| |
580 |
616 |
581 textView model notNil ifTrue:[ |
617 textView model notNil ifTrue:[ |
582 oldValue := textView model value. |
618 oldValue := textView model value. |
583 textView model removeDependent:self. |
619 textView model removeDependent:self. |
584 ]. |
620 ]. |
585 textView model: aValueModel. |
621 textView model: aValueModel. |
586 textView model notNil ifTrue:[ |
622 textView model notNil ifTrue:[ |
587 textView model addDependent:self. |
623 textView model addDependent:self. |
588 ]. |
624 ]. |
589 newValue := textView model value. |
625 newValue := textView model value. |
590 oldValue ~~ newValue ifTrue:[ |
626 oldValue ~~ newValue ifTrue:[ |
591 self update:#value with:newValue from:textView model. |
627 self update:#value with:newValue from:textView model. |
592 ]. |
628 ]. |
593 |
629 |
594 "Modified: / 27-07-2011 / 12:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
630 "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
595 ! |
631 ! |
596 |
632 |
597 modified |
633 modified |
598 "return true if text was modified" |
634 "return true if text was modified" |
599 |
635 |
656 (synchronizedCodeViews includes: aCodeView) ifTrue:[^self]. |
692 (synchronizedCodeViews includes: aCodeView) ifTrue:[^self]. |
657 synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView. |
693 synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView. |
658 |
694 |
659 "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>" |
695 "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>" |
660 "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
696 "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
661 ! ! |
697 ! |
662 |
698 |
663 !CodeView2 methodsFor:'accessing-code component'! |
699 unsynchronizeWith: aCodeView |
|
700 |
|
701 self assert: aCodeView ~= self. |
|
702 (synchronizedCodeViews includes: aCodeView) ifFalse:[^self]. |
|
703 synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView. |
|
704 |
|
705 "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>" |
|
706 "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
707 "Created: / 19-03-2012 / 14:25:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
708 ! ! |
|
709 |
|
710 !CodeView2 methodsFor:'accessing - code component'! |
664 |
711 |
665 klass |
712 klass |
666 | v | |
713 | v | |
667 |
714 |
668 (v := self classHolder value) notNil ifTrue:[^v]. |
715 (v := self classHolder value) notNil ifTrue:[^v]. |
669 (v := self method) notNil ifTrue:[^v mclass]. |
716 (v := self method) notNil ifTrue:[^v mclass]. |
670 |
717 |
671 ^UndefinedObject |
718 ^nil |
672 |
719 |
673 "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
720 "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
674 "Modified: / 22-07-2013 / 13:34:05 / cg" |
721 "Modified: / 22-07-2013 / 13:34:05 / cg" |
675 ! |
722 ! ! |
|
723 |
|
724 !CodeView2 methodsFor:'accessing-code component'! |
676 |
725 |
677 klass: aClass |
726 klass: aClass |
678 |
727 |
679 "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
728 "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
680 ! |
729 ! |
764 ]. |
813 ]. |
765 |
814 |
766 self changed: #classHolder with: old -> classHolder |
815 self changed: #classHolder with: old -> classHolder |
767 |
816 |
768 "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
817 "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
818 ! |
|
819 |
|
820 currentBlockNodeHolder |
|
821 "return/create the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
822 |
|
823 currentBlockNodeHolder isNil ifTrue:[ |
|
824 currentBlockNodeHolder := ValueHolder new. |
|
825 ]. |
|
826 ^ currentBlockNodeHolder |
|
827 ! |
|
828 |
|
829 currentBlockNodeHolder:something |
|
830 "set the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
831 |
|
832 currentBlockNodeHolder := something. |
|
833 ! |
|
834 |
|
835 currentParseNodeHolder |
|
836 "return/create the 'currentParseNodeHolder' value holder (automatically generated)" |
|
837 |
|
838 currentParseNodeHolder isNil ifTrue:[ |
|
839 currentParseNodeHolder := ValueHolder new. |
|
840 ]. |
|
841 ^ currentParseNodeHolder |
|
842 ! |
|
843 |
|
844 currentParseNodeHolder:something |
|
845 "set the 'currentParseNodeHolder' value holder (automatically generated)" |
|
846 |
|
847 currentParseNodeHolder := something. |
|
848 gutterView notNil ifTrue:[ gutterView currentBlockNodeHolder: currentBlockNodeHolder ]. |
|
849 |
|
850 "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
769 ! |
851 ! |
770 |
852 |
771 languageHolder |
853 languageHolder |
772 languageHolder isNil ifTrue:[ |
854 languageHolder isNil ifTrue:[ |
773 "/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.) |
855 "/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.) |
882 |
964 |
883 update:aspect with:param from:sender |
965 update:aspect with:param from:sender |
884 |
966 |
885 |
967 |
886 sender == methodHolder ifTrue:[ |
968 sender == methodHolder ifTrue:[ |
887 textView editedMethodOrClass: methodHolder value. |
969 textView editedMethodOrClass: methodHolder value. |
888 ]. |
970 ]. |
889 |
971 |
890 sender == classHolder ifTrue:[ |
972 sender == classHolder ifTrue:[ |
891 methodHolder value isNil ifTrue:[ |
973 methodHolder value isNil ifTrue:[ |
892 textView editedMethodOrClass: classHolder value. |
974 textView editedMethodOrClass: classHolder value. |
893 ]. |
975 ]. |
894 ]. |
976 ]. |
895 |
977 |
896 sender == languageHolder ifTrue:[ |
978 sender == languageHolder ifTrue:[ |
897 textView editedLanguage: languageHolder value. |
979 textView editedLanguage: languageHolder value. |
|
980 ]. |
|
981 |
|
982 sender == modeHolder ifTrue:[ |
|
983 codeAspect := modeHolder value |
898 ]. |
984 ]. |
899 |
985 |
900 sender == showGutterChannel ifTrue: [ |
986 sender == showGutterChannel ifTrue: [ |
901 self updateGutterVisibility. |
987 self updateGutterVisibility. |
902 ^self. |
988 ^self. |
903 ]. |
989 ]. |
904 |
990 |
905 services do:[:each | |
991 services do:[:each | |
906 each isEnabled ifTrue:[ |
992 each isEnabled ifTrue:[ |
907 each update:aspect with:param from:sender |
993 each update:aspect with:param from:sender |
908 ] |
994 ] |
909 ]. |
995 ]. |
910 |
996 |
911 super update:aspect with:param from:sender |
997 super update:aspect with:param from:sender |
912 |
998 |
913 "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
999 "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
1149 ^textView hasSelection |
1234 ^textView hasSelection |
1150 |
1235 |
1151 "Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1236 "Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1152 ! ! |
1237 ! ! |
1153 |
1238 |
|
1239 !CodeView2 methodsFor:'delegation - events'! |
|
1240 |
|
1241 buttonPress: button x:x y:y in: view |
|
1242 "Delegates events to services. Answers true iff at least |
|
1243 one service handler method returns true. In that case, |
|
1244 the event is is NOT processes by the view." |
|
1245 |
|
1246 ^ services |
|
1247 contains:[:service | |
|
1248 service isEnabled and:[ ((service buttonPress: button x:x y:y in: view) == true) ] |
|
1249 ]. |
|
1250 |
|
1251 "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1252 "Modified: / 06-10-2011 / 14:14:00 / cg" |
|
1253 "Modified (format): / 05-03-2012 / 08:56:02 / cg" |
|
1254 ! |
|
1255 |
|
1256 scrollTo:origin redraw:doRedraw in: view |
|
1257 view == textView ifTrue: [ |
|
1258 "/my text view scrolled... |
|
1259 synchronizedCodeViews do:[:codeView| |
|
1260 codeView scrollTo:origin redraw:doRedraw in: view. |
|
1261 ] |
|
1262 ] ifFalse: [ |
|
1263 "/other code view scrolls and I'm notified about that |
|
1264 textView basicScrollTo:origin redraw:doRedraw. |
|
1265 ] |
|
1266 |
|
1267 "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>" |
|
1268 "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1269 ! ! |
|
1270 |
1154 !CodeView2 methodsFor:'delegation-drawing'! |
1271 !CodeView2 methodsFor:'delegation-drawing'! |
1155 |
1272 |
1156 drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg |
1273 drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg |
1157 "See the comment in |
1274 "See the comment in |
1158 CodeViewService>>drawLine:in:atX..." |
1275 CodeViewService>>drawLine:in:atX..." |
1198 service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ] |
1315 service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ] |
1199 ]. |
1316 ]. |
1200 |
1317 |
1201 "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1318 "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1202 "Modified: / 06-10-2011 / 14:13:57 / cg" |
1319 "Modified: / 06-10-2011 / 14:13:57 / cg" |
1203 ! |
|
1204 |
|
1205 buttonPress: button x:x y:y in: view |
|
1206 "Delegates events to services. Answers true iff at least |
|
1207 one service handler method returns true. |
|
1208 In that case, the event is is NOT processes by the view." |
|
1209 |
|
1210 ^ services |
|
1211 contains:[:service | |
|
1212 (service isEnabled |
|
1213 and:[ ((service buttonPress: button x:x y:y in: view) == true) ]) |
|
1214 ]. |
|
1215 |
|
1216 "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1217 "Modified (comment): / 29-08-2013 / 16:23:08 / cg" |
|
1218 ! |
1320 ! |
1219 |
1321 |
1220 buttonRelease: button x:x y:y in: view |
1322 buttonRelease: button x:x y:y in: view |
1221 "Delegates events to services. Answers true iff at least |
1323 "Delegates events to services. Answers true iff at least |
1222 one service handler method returns true. In that case, |
1324 one service handler method returns true. In that case, |
1381 ! |
1483 ! |
1382 |
1484 |
1383 initialize |
1485 initialize |
1384 "Invoked when a new instance is created." |
1486 "Invoked when a new instance is created." |
1385 "Call super initialize" |
1487 "Call super initialize" |
1386 |
1488 |
1387 super initialize. |
1489 super initialize. |
1388 "Now set up some visual properties" |
1490 "Now set up some visual properties" |
1389 self level:-1. |
1491 self level:-1. |
1390 "Now initialize sub-views" |
1492 "Now initialize sub-views" |
1391 showGutterChannel := ValueHolder with: true. |
1493 showGutterChannel := ValueHolder with: true. |
1392 showGutterChannel addDependent: self. |
1494 showGutterChannel addDependent: self. |
1393 "/ toDo: I don't like two options in the settings; |
1495 "/ toDo: I don't like two options in the settings; |
1394 "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)). |
1496 "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)). |
1395 showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel). |
1497 showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel). |
1396 |
1498 |
1397 "/ these views must be created first, as they refer to each other's channels in their |
1499 "/ these views must be created first, as they refer to each other's channels in their |
1401 textView := textViewScroller scrolledView. |
1503 textView := textViewScroller scrolledView. |
1402 |
1504 |
1403 self initializeGutterView. |
1505 self initializeGutterView. |
1404 self initializeTextView. |
1506 self initializeTextView. |
1405 textView setCodeView:self. |
1507 textView setCodeView:self. |
1406 modifiedChannel := ValueHolder with:false. |
1508 modifiedChannel := ValueHolder with:false. |
1407 diffMode := false. |
1509 diffMode := false. |
1408 synchronizedCodeViews := #(). |
1510 synchronizedCodeViews := #(). |
|
1511 currentParseNodeHolder := ValueHolder new. |
|
1512 currentBlockNodeHolder := ValueHolder new. |
1409 |
1513 |
1410 servicesFromClient := false. |
1514 servicesFromClient := false. |
1411 services := OrderedCollection new. |
1515 services := OrderedCollection new. |
1412 self initializeServices. |
1516 self initializeServices. |
1413 |
1517 |
1414 "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>" |
1518 "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>" |
1415 "Modified: / 06-04-2010 / 13:56:35 / Jakub <zelenja7@fel.cvut.cz>" |
1519 "Modified: / 06-04-2010 / 13:56:35 / Jakub <zelenja7@fel.cvut.cz>" |
1416 "Modified: / 06-10-2011 / 14:15:48 / cg" |
1520 "Modified: / 06-10-2011 / 14:15:48 / cg" |
1417 "Modified: / 18-10-2011 / 19:17:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1521 "Modified: / 16-02-2012 / 23:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1418 ! |
1522 ! |
1419 |
1523 |
1420 initializeGutterView |
1524 initializeGutterView |
1421 |
1525 |
1422 gutterView setCodeView:self. |
1526 gutterView setCodeView:self. |
1629 "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1733 "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1630 "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1734 "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1631 "Modified: / 05-03-2012 / 09:02:43 / cg" |
1735 "Modified: / 05-03-2012 / 09:02:43 / cg" |
1632 ! |
1736 ! |
1633 |
1737 |
1634 implementorsMenu: implementors selector: selector |
1738 implementorsMenu: implementors selector: selector |
1635 | menu| |
1739 | menu| |
1636 |
1740 |
1637 menu := Menu new. |
1741 menu := Menu new. |
1638 implementors isEmptyOrNil ifTrue:[ |
1742 implementors isEmptyOrNil ifTrue:[ |
1639 menu addItem:(MenuItem label:'No implementors found') disable |
1743 menu addItem:(MenuItem label:'No implementors found') disable |
1640 ] ifFalse:[ |
1744 ] ifFalse:[ |
1641 menu addItem:(MenuItem |
1745 menu addItem:(MenuItem |
1642 label:(selector "storeString" , (' (all implementors) ') asText allItalic) |
1746 label:(selector storeString , (' (all implementors) ') asText allItalic) |
1643 itemValue:[ |
1747 itemValue:[ |
1644 self browseMethods:implementors |
1748 self browseMethods:implementors |
1645 label:'Implementors of ' , selector "storeString" |
1749 label:'Implementors of ' , selector storeString |
1646 ]). |
1750 ]). |
1647 |
1751 |
1648 menu addSeparator. |
1752 menu addSeparator. |
1649 "/ (implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name]) |
1753 (implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name]) |
1650 (implementors asOrderedCollection sort:[:a :b | a selector < b selector]) |
1754 "implementors" do:[:mth | |
1651 "implementors" do:[:mth | |
1755 menu |
1652 menu |
1756 addItem:(MenuItem label:(selector storeString |
1653 addItem:(MenuItem label:(selector "storeString" allBold |
1757 , (' in ' , mth containingClass nameInBrowser asText allBold)) |
1654 , (' in ' , mth containingClass name "asText allBold")) |
1758 itemValue:[ self browseMethod:mth label: 'Implementor of ' , selector storeString ]) |
1655 value:[ self browseMethod:mth label: 'Implementor of ' , selector "storeString" ]) |
1759 ] |
1656 ] |
|
1657 ]. |
1760 ]. |
1658 ^ menu |
1761 ^ menu |
1659 |
1762 |
1660 "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1763 "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1661 "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1764 "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1662 "Modified: / 28-08-2013 / 22:03:06 / cg" |
1765 "Modified: / 07-03-2012 / 12:56:56 / cg" |
|
1766 "Modified: / 14-10-2013 / 10:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1663 ! |
1767 ! |
1664 |
1768 |
1665 sendersMenu |
1769 sendersMenu |
1666 |
1770 |
1667 | selectorAndSelectedText selector selectedText senders | |
1771 | selectorAndSelectedText selector selectedText senders | |
1695 "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1799 "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1696 "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1800 "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1697 "Modified: / 05-03-2012 / 09:02:56 / cg" |
1801 "Modified: / 05-03-2012 / 09:02:56 / cg" |
1698 ! |
1802 ! |
1699 |
1803 |
1700 sendersMenu: senders selector: selector |
1804 sendersMenu: senders selector: selector |
1701 | menu shownSenderItems numCut sendersSorted| |
1805 | menu shownSenderItems numCut sendersSorted| |
1702 |
1806 |
1703 menu := Menu new. |
1807 menu := Menu new. |
1704 senders isEmptyOrNil ifTrue:[ |
1808 senders isEmptyOrNil ifTrue:[ |
1705 menu addItem:(MenuItem label:'No senders found') disable |
1809 menu addItem:(MenuItem label:'No senders found') disable |
1706 ] ifFalse:[ |
1810 ] ifFalse:[ |
1707 menu addItem:(MenuItem |
1811 menu addItem:(MenuItem |
1708 label:(selector "storeString" , (' (all senders)') asText allItalic) |
1812 label:(selector storeString , (' (all senders)') asText allItalic) |
1709 itemValue:[ |
1813 itemValue:[ |
1710 self browseMethods:senders |
1814 self browseMethods:senders |
1711 label:'Senders of ' , selector "storeString" |
1815 label:'Senders of ' , selector storeString |
1712 ]). |
1816 ]). |
1713 menu addSeparator. |
1817 menu addSeparator. |
1714 "/ sendersSorted := senders asOrderedCollection |
1818 sendersSorted := senders asOrderedCollection |
1715 "/ sort:[:a :b | a whoString < b whoString]. |
1819 sort:[:a :b | a whoString < b whoString]. |
1716 sendersSorted := senders asOrderedCollection |
1820 shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted]. |
1717 sort:[:a :b | a selector < b selector]. |
1821 numCut := senders size - 20. |
1718 shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted]. |
1822 shownSenderItems do:[:mth | |
1719 numCut := senders size - 20. |
1823 menu |
1720 shownSenderItems do:[:mth | |
1824 addItem:(MenuItem label:(mth selector storeString |
1721 menu |
1825 , (' in ' , mth containingClass nameInBrowser asText allBold)) |
1722 addItem:(MenuItem label:(mth selector "storeString" allBold |
1826 itemValue:[ self browseMethod:mth label: 'Sender of ' , selector storeString ]) |
1723 , (' in ' , mth containingClass name "asText allBold")) |
1827 ]. |
1724 value:[ self browseMethod:mth label: 'Sender of ' , selector "storeString" ]) |
1828 numCut > 0 ifTrue:[ |
1725 ]. |
1829 menu addSeparator. |
1726 numCut > 0 ifTrue:[ |
1830 menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable |
1727 menu addSeparator. |
1831 ]. |
1728 menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable |
|
1729 ]. |
|
1730 ]. |
1832 ]. |
1731 ^ menu |
1833 ^ menu |
1732 |
1834 |
1733 "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1835 "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1734 "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1836 "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1735 "Modified: / 07-07-2011 / 14:51:54 / jv" |
1837 "Modified: / 07-07-2011 / 14:51:54 / jv" |
1736 "Modified: / 28-08-2013 / 22:03:57 / cg" |
1838 "Modified: / 07-03-2012 / 12:58:31 / cg" |
|
1839 "Modified: / 14-10-2013 / 10:47:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1737 ! |
1840 ! |
1738 |
1841 |
1739 servicesMenu |
1842 servicesMenu |
1740 |menu item anyService| |
1843 |menu item anyService| |
1741 |
1844 |
2100 |
2218 |
2101 middleButtonMenu |
2219 middleButtonMenu |
2102 menuHolder notNil ifTrue:[^ menuHolder value]. |
2220 menuHolder notNil ifTrue:[^ menuHolder value]. |
2103 codeView isNil ifTrue:[^ nil]. |
2221 codeView isNil ifTrue:[^ nil]. |
2104 ^ codeView servicesMenu |
2222 ^ codeView servicesMenu |
|
2223 ! ! |
|
2224 |
|
2225 !CodeView2::GutterView methodsFor:'aspects'! |
|
2226 |
|
2227 currentBlockNodeHolder |
|
2228 "return/create the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
2229 |
|
2230 currentBlockNodeHolder isNil ifTrue:[ |
|
2231 currentBlockNodeHolder := ValueHolder new. |
|
2232 currentBlockNodeHolder addDependent:self. |
|
2233 ]. |
|
2234 ^ currentBlockNodeHolder |
|
2235 ! |
|
2236 |
|
2237 currentBlockNodeHolder:something |
|
2238 "set the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
2239 |
|
2240 |oldValue newValue| |
|
2241 |
|
2242 currentBlockNodeHolder notNil ifTrue:[ |
|
2243 oldValue := currentBlockNodeHolder value. |
|
2244 currentBlockNodeHolder removeDependent:self. |
|
2245 ]. |
|
2246 currentBlockNodeHolder := something. |
|
2247 currentBlockNodeHolder notNil ifTrue:[ |
|
2248 currentBlockNodeHolder addDependent:self. |
|
2249 ]. |
|
2250 newValue := currentBlockNodeHolder value. |
|
2251 oldValue ~~ newValue ifTrue:[ |
|
2252 self update:#value with:newValue from:currentBlockNodeHolder. |
|
2253 ]. |
2105 ! ! |
2254 ! ! |
2106 |
2255 |
2107 !CodeView2::GutterView methodsFor:'change & update'! |
2256 !CodeView2::GutterView methodsFor:'change & update'! |
2108 |
2257 |
2109 adjustSizeForLongestLine |
2258 adjustSizeForLongestLine |
2140 |
2289 |
2141 update:something with:aParameter from:changedObject |
2290 update:something with:aParameter from:changedObject |
2142 "/ self shown ifFalse:[^self]. |
2291 "/ self shown ifFalse:[^self]. |
2143 |
2292 |
2144 (changedObject == textView) ifTrue:[ |
2293 (changedObject == textView) ifTrue:[ |
2145 ((something == #sizeOfContents) |
2294 ((something == #sizeOfContents) |
2146 or:[ false "(something == #sizeOfView)" ]) ifTrue:[ |
2295 or:[ false "(something == #sizeOfView)" ]) ifTrue:[ |
2147 self adjustSizeForLongestLine. |
2296 self adjustSizeForLongestLine. |
2148 |
2297 |
2149 "/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[ |
2298 "/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[ |
2150 "/ self invalidate. |
2299 "/ self invalidate. |
2151 "/ ]. |
2300 "/ ]. |
2152 ^ self. |
2301 ^ self. |
2153 ]. |
2302 ]. |
2154 something == #originOfContents ifTrue:[ |
2303 something == #originOfContents ifTrue:[ |
2155 self invalidate. |
2304 self invalidateLines. |
2156 ^ self. |
2305 ^ self. |
2157 ]. |
2306 ]. |
2158 "/ something printCR. |
2307 "/ something printCR. |
2159 ]. |
2308 ]. |
2160 |
2309 |
2161 (changedObject == textView reallyModifiedChannel) ifTrue:[ |
2310 (changedObject == textView reallyModifiedChannel) ifTrue:[ |
2162 "/ cg: I think this is rubbish: if any service needs that, it should make itself |
2311 self invalidateAcceptCancelBar. |
2163 "/ dependent of it itself (leads to many redraws for non-existing accept-cancel bar, |
2312 ^self. |
2164 "/ if no such service is active) |
|
2165 "/ self invalidate. |
|
2166 ^ self. |
|
2167 ]. |
2313 ]. |
2168 |
2314 |
2169 super update:something with:aParameter from:changedObject |
2315 super update:something with:aParameter from:changedObject |
2170 |
2316 |
2171 "Modified (format): / 15-07-2011 / 20:14:04 / cg" |
2317 "Modified (format): / 15-07-2011 / 20:14:04 / cg" |
2172 "Modified: / 07-10-2011 / 19:25:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2318 "Modified: / 10-09-2013 / 03:15:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2173 ! ! |
2319 ! ! |
2174 |
2320 |
2175 !CodeView2::GutterView methodsFor:'event handling'! |
2321 !CodeView2::GutterView methodsFor:'event handling'! |
2176 |
2322 |
2177 buttonPress: btn x: x y: y |
2323 buttonPress: btn x: x y: y |
2244 ! |
2397 ! |
2245 |
2398 |
2246 setCodeView: aCodeView2 |
2399 setCodeView: aCodeView2 |
2247 |
2400 |
2248 codeView := aCodeView2. |
2401 codeView := aCodeView2. |
2249 textView := aCodeView2 textView. |
|
2250 |
2402 |
2251 codeView addDependent: self. |
2403 codeView addDependent: self. |
2252 codeView reallyModifiedChannel addDependent: self. |
2404 codeView reallyModifiedChannel addDependent: self. |
|
2405 codeView currentBlockNodeHolder addDependent: self. |
|
2406 |
|
2407 textView := aCodeView2 textView. |
2253 textView addDependent: self. |
2408 textView addDependent: self. |
|
2409 self currentBlockNodeHolder: codeView currentBlockNodeHolder. |
2254 textViewScroller := aCodeView2 textViewScroller. |
2410 textViewScroller := aCodeView2 textViewScroller. |
2255 "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)). |
2411 "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)). |
2256 self viewBackground: (View defaultBackgroundColor). |
2412 self viewBackground: (View defaultBackgroundColor). |
2257 |
2413 |
2258 "Created: / 14-02-2010 / 15:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2414 "Created: / 14-02-2010 / 15:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2259 "Modified: / 17-08-2011 / 15:15:55 / cg" |
2415 "Modified: / 17-08-2011 / 15:15:55 / cg" |
2260 "Modified: / 08-10-2011 / 11:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2416 "Modified: / 05-04-2012 / 17:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2261 ! ! |
2417 ! ! |
2262 |
2418 |
2263 !CodeView2::GutterView methodsFor:'queries'! |
2419 !CodeView2::GutterView methodsFor:'queries'! |
2264 |
2420 |
2265 displayedString: line |
2421 displayedString: line |
2303 the textView (because gutter may become higher than textView, iff |
2459 the textView (because gutter may become higher than textView, iff |
2304 the textView has a horizontal scrollbar" |
2460 the textView has a horizontal scrollbar" |
2305 |
2461 |
2306 |visibleLineNr "{ Class: SmallInteger }"| |
2462 |visibleLineNr "{ Class: SmallInteger }"| |
2307 |
2463 |
|
2464 "/JV: BAD, BAD BAD - check senders, they are not prepared |
|
2465 "/ to get nil!! |
2308 shown ifFalse:[^ nil]. |
2466 shown ifFalse:[^ nil]. |
2309 lineNr isNil ifTrue:[^ nil]. |
2467 lineNr isNil ifTrue:[^ nil]. |
2310 visibleLineNr := lineNr - textView firstLineShown + 1. |
2468 visibleLineNr := lineNr - textView firstLineShown + 1. |
2311 ^ textView yOfVisibleLine:visibleLineNr |
2469 ^ textView yOfVisibleLine:visibleLineNr |
|
2470 |
|
2471 "Modified (format): / 28-08-2013 / 12:49:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2312 ! ! |
2472 ! ! |
2313 |
2473 |
2314 !CodeView2::GutterView methodsFor:'redrawing'! |
2474 !CodeView2::GutterView methodsFor:'redrawing'! |
|
2475 |
|
2476 invalidateAcceptCancelBar |
|
2477 | w | |
|
2478 |
|
2479 (widthAcceptCancel ? 0) == 0 ifTrue:[ ^ self ]. |
|
2480 w := ((self paddingLeft) + (widthAcceptCancel ? 0)) + 1. |
|
2481 self |
|
2482 invalidateX: 0 |
|
2483 y: 0 |
|
2484 width: w |
|
2485 height: self height. |
|
2486 |
|
2487 "Created: / 10-09-2013 / 03:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2488 ! |
2315 |
2489 |
2316 invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
2490 invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
2317 ^ super invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
2491 ^ super invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
2318 ! |
2492 ! |
2319 |
2493 |
|
2494 invalidateLines |
|
2495 |
|
2496 | x0 | |
|
2497 x0 := ((self paddingLeft) + (widthAcceptCancel ? 0)) + 1. |
|
2498 self |
|
2499 invalidateX: x0 |
|
2500 y: 0 |
|
2501 width: self width - x0 |
|
2502 height: self height. |
|
2503 |
|
2504 "Created: / 10-09-2013 / 03:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2505 ! |
|
2506 |
2320 redrawAcceptCancelBarX: x y: y width:w height:h |
2507 redrawAcceptCancelBarX: x y: y width:w height:h |
2321 |
2508 |
2322 | rw acceptBottom cancelBottom | |
2509 | rw acceptBottom cancelBottom | |
2323 |
2510 |
2324 x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[ |
2511 x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[ |
2325 ^self. |
2512 ^self. |
2326 ]. |
2513 ]. |
2327 rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x. |
2514 rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x. |
2328 |
2515 |
2329 |
2516 |
2330 textView reallyModified ifFalse:[ |
2517 textView reallyModified ifFalse:[ |
2331 self fillRectangleX:x y:y width:rw height:h color: self viewBackground |
2518 self fillRectangleX:x y:y width:rw height:h color: self viewBackground |
2332 ] ifTrue:[ |
2519 ] ifTrue:[ |
2333 acceptBottom := self acceptButtonBottom. |
2520 acceptBottom := self acceptButtonBottom. |
2334 cancelBottom := self cancelButtonBottom. |
2521 cancelBottom := self cancelButtonBottom. |
2335 y < acceptBottom ifTrue:[ |
2522 y < acceptBottom ifTrue:[ |
2336 self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor. |
2523 self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor. |
2337 ]. |
2524 ]. |
2338 (y < cancelBottom) ifTrue:[ |
2525 (y < cancelBottom) ifTrue:[ |
2339 self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor. |
2526 self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor. |
2340 ]. |
2527 ]. |
2341 (y + h >= cancelBottom) ifTrue:[ |
2528 (y + h >= cancelBottom) ifTrue:[ |
2342 self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor. |
2529 self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor. |
2343 ] |
2530 ] |
2344 |
2531 |
2345 ] |
2532 ] |
2346 |
2533 |
2347 "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2534 "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2535 "Modified: / 10-09-2013 / 03:03:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2348 ! |
2536 ! |
2349 |
2537 |
2350 redrawBackgroundX:x y:y width:w height:h |
2538 redrawBackgroundX:x y:y width:w height:h |
2351 "redraws gutter background" |
2539 "redraws gutter background" |
2352 |
2540 |
2389 |
2577 |
2390 ^ self redrawLine:line cleared:cleared drawServices:true |
2578 ^ self redrawLine:line cleared:cleared drawServices:true |
2391 ! |
2579 ! |
2392 |
2580 |
2393 redrawLine:line cleared:cleared drawServices:drawServices |
2581 redrawLine:line cleared:cleared drawServices:drawServices |
2394 "redraws specified line. Returns width of drawn object. |
2582 "redraws specified line. Returns width of drawn object. |
2395 Color of drawn objects should be taken from lineFont, lineColor" |
2583 Color of drawn objects should be taken from lineFont, lineColor" |
2396 |
2584 |
2397 |lineString yTop yBaseline fontAscent fontDescent |
2585 |lineString yTop yBaseline fontAscent fontDescent |
2398 textW requiredW oldFont newFont oldColor newColor| |
2586 textW requiredW oldFont newFont oldColor newColor| |
2399 |
2587 |
|
2588 shown ifFalse:[ ^ self ]. "/ Do not bother if the view is not shown. |
2400 textView isNil ifTrue:[^ self]. "/ happens when shown in UIPainter |
2589 textView isNil ifTrue:[^ self]. "/ happens when shown in UIPainter |
2401 |
2590 |
2402 requiredW := self width. |
2591 requiredW := self width. |
2403 |
2592 |
2404 showLineNumbers ifTrue:[ |
2593 showLineNumbers ifTrue:[ |
2405 lineString := self displayedString:line. |
2594 lineString := self displayedString:line. |
2406 |
2595 |
2407 textW := (lineString widthOn:self). |
2596 textW := (lineString widthOn:self). |
2408 requiredW := textW + self padding. |
2597 requiredW := textW + self padding. |
2409 |
2598 |
2410 oldFont := self font. |
2599 oldFont := self font. |
2411 oldColor := self paint. |
2600 oldColor := self paint. |
2412 |
2601 |
2413 newFont := self lineFontForLine:line. |
2602 newFont := self lineFontForLine:line. |
2414 newFont isNil ifTrue:[ |
2603 newFont isNil ifTrue:[ |
2415 newFont := oldFont. |
2604 newFont := oldFont. |
2416 newColor := self lineColorForLine:line. |
2605 newColor := self lineColorForLine:line. |
2417 newColor ifNotNil:[ self paint:newColor ]. |
2606 newColor ifNotNil:[ self paint:newColor ]. |
2418 ]. |
2607 ]. |
2419 newFont ~~ oldFont ifTrue:[ |
2608 newFont ~~ oldFont ifTrue:[ |
2420 "/ ensure that the line number lines are not higher than the text lines |
2609 "/ ensure that the line number lines are not higher than the text lines |
2421 (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[ |
2610 (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[ |
2422 newFont := textView font. |
2611 newFont := textView font. |
2423 ]. |
2612 ]. |
2424 newFont ~~ oldFont ifTrue:[ |
2613 newFont ~~ oldFont ifTrue:[ |
2425 self font:newFont |
2614 self font:newFont |
2426 ]. |
2615 ]. |
2427 ]. |
2616 ]. |
2428 ]. |
2617 ]. |
2429 |
2618 |
2430 fontAscent := textView font ascentOn:device. |
2619 fontAscent := textView font ascentOn:device. |
2431 fontDescent := textView font descentOn:device. |
2620 fontDescent := textView font descentOn:device. |
2432 |
2621 |
2433 yTop := (self yOfTextViewLine:line) ? 0. |
2622 yTop := (self yOfTextViewLine:line) ? 0. |
2434 yBaseline := yTop + fontAscent. |
2623 yBaseline := yTop + fontAscent. |
2435 |
2624 |
2436 cleared ifFalse:[ |
2625 cleared ifFalse:[ |
2437 self clearRectangleX:0 y:yBaseline - font ascent |
2626 self clearRectangleX:0 y:yBaseline - font ascent |
2438 width: width - 2 |
2627 width: width - 2 |
2439 height: font ascent + font descent. |
2628 height: font ascent + font descent. |
2440 ]. |
2629 ]. |
2441 |
2630 |
2442 "/ cg: this should be done differently: services know about the |
2631 "/ cg: this should be done differently: services know about the |
2443 "/ gutter, so they should respond to a special drawGutter message. |
2632 "/ gutter, so they should respond to a special drawGutter message. |
2444 "/ otherwise, some redraws become unusably slow (especially |
2633 "/ otherwise, some redraws become unusably slow (especially |
2445 "/ with multiple fonts/colors/emphases)... |
2634 "/ with multiple fonts/colors/emphases)... |
2446 drawServices ifTrue:[ |
2635 drawServices ifTrue:[ |
2447 "Let services draw annotations and other stuff" |
2636 "Let services draw annotations and other stuff" |
2448 codeView notNil ifTrue:[ |
2637 codeView notNil ifTrue:[ |
2449 codeView |
2638 codeView |
2450 drawLine:line in: self |
2639 drawLine:line in: self |
2451 atX: (self paddingLeft + self usedWidthForAcceptCancel) y:yBaseline width: widthAnnotations height: font height |
2640 atX: (self paddingLeft + self usedWidthForAcceptCancel) y:yBaseline width: widthAnnotations height: font height |
2452 from:nil to:nil with:self paint and: self backgroundColor. |
2641 from:nil to:nil with:self paint and: self backgroundColor. |
2453 ] |
2642 ] |
2454 ]. |
2643 ]. |
2455 |
2644 |
2456 showLineNumbers ifTrue:[ |
2645 showLineNumbers ifTrue:[ |
2457 self |
2646 self |
2458 displayString:lineString |
2647 displayString:lineString |
2459 x:(width - textW - 2 - self paddingRight - widthDiffInfo) |
2648 x:(width - textW - 2 - self paddingRight - widthDiffInfo) |
2460 y:yBaseline. |
2649 y:yBaseline. |
2461 |
2650 |
2462 newFont |
2651 newFont |
2463 ifNotNil:[ |
2652 ifNotNil:[ |
2464 self font:oldFont. |
2653 self font:oldFont. |
2465 self paint:oldColor |
2654 self paint:oldColor |
2466 ] |
2655 ] |
2467 ifNil:[ |
2656 ifNil:[ |
2468 newColor ifNotNil:[ self paint:oldColor ]. |
2657 newColor ifNotNil:[ self paint:oldColor ]. |
2469 ]. |
2658 ]. |
2470 ]. |
2659 ]. |
2471 |
2660 |
|
2661 "/ If the view has been cleared here, we have also to redraw corresponding portion |
|
2662 "/ of accept/cancel bar !! |
|
2663 cleared ifFalse:[ |
|
2664 "/ In that case it was cleared above. |
|
2665 self redrawAcceptCancelBarX:0 y:yBaseline - font ascent |
|
2666 width: width - 2 |
|
2667 height: font ascent + font descent. |
|
2668 ]. |
2472 ^ requiredW. |
2669 ^ requiredW. |
2473 |
2670 |
2474 "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>" |
2671 "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>" |
2475 "Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2672 "Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2476 "Modified: / 18-07-2012 / 19:05:24 / cg" |
2673 "Modified: / 18-07-2012 / 19:05:24 / cg" |
|
2674 "Modified: / 28-08-2013 / 15:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2477 ! |
2675 ! |
2478 |
2676 |
2479 redrawLinesFrom:start |
2677 redrawLinesFrom:start |
2480 "/ cg: obsolete? |
2678 "/ cg: obsolete? |
2481 start to: (textView lastLineShown - 1 min: textView list size) do:[:line| |
2679 start to: (textView lastLineShown - 1 min: textView list size) do:[:line| |
2644 |
2859 |
2645 super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings. |
2860 super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings. |
2646 |
2861 |
2647 listOriginal := aCollection copy. |
2862 listOriginal := aCollection copy. |
2648 reallyModifiedChannel value: false. |
2863 reallyModifiedChannel value: false. |
2649 self notifyLinesModifiedFrom: 1 to: list size. |
2864 |
|
2865 "/JV: used to be notifyLines... but that method |
|
2866 "/ leaves suppressNotifications to true, which is not what |
|
2867 "/ we want!! |
|
2868 self updateReallyModified. |
|
2869 codeView linesModifiedFrom: 1 to: list size. |
2650 |
2870 |
2651 "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2871 "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2872 "Modified (comment): / 03-08-2013 / 13:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2652 ! |
2873 ! |
2653 |
2874 |
2654 setList:aCollection expandTabs:expandTabs redraw:doRedraw |
2875 setList:aCollection expandTabs:expandTabs redraw:doRedraw |
2655 |
2876 |
2656 super setList:aCollection expandTabs:expandTabs redraw:doRedraw. |
2877 super setList:aCollection expandTabs:expandTabs redraw:doRedraw. |
2657 listOriginal := aCollection copy. |
2878 listOriginal := aCollection copy. |
2658 reallyModifiedChannel value: false. |
2879 reallyModifiedChannel value: false. |
2659 self notifyLinesModifiedFrom: 1 to: list size. |
2880 |
|
2881 "/JV: used to be notifyLines... but that method |
|
2882 "/ leaves suppressNotifications to true, which is not what |
|
2883 "/ we want!! |
|
2884 self updateReallyModified. |
|
2885 codeView linesModifiedFrom: 1 to: list size. |
2660 |
2886 |
2661 "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2887 "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2888 "Modified (comment): / 03-08-2013 / 13:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2889 ! ! |
|
2890 |
|
2891 !CodeView2::TextView methodsFor:'accessing-look'! |
|
2892 |
|
2893 lineSpacing |
|
2894 |
|
2895 ^lineSpacing |
|
2896 |
|
2897 "Modified: / 22-05-1996 / 12:22:29 / cg" |
|
2898 "Created: / 19-03-2012 / 13:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2662 ! ! |
2899 ! ! |
2663 |
2900 |
2664 !CodeView2::TextView methodsFor:'accessing-state'! |
2901 !CodeView2::TextView methodsFor:'accessing-state'! |
2665 |
2902 |
2666 beUnmodified |
2903 beUnmodified |
2739 ^ self sensor metaDown not |
2998 ^ self sensor metaDown not |
2740 ! ! |
2999 ! ! |
2741 |
3000 |
2742 !CodeView2::TextView methodsFor:'drawing'! |
3001 !CodeView2::TextView methodsFor:'drawing'! |
2743 |
3002 |
2744 drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
3003 backgroundForVisibleLine:visLineNr default:bg |
2745 |
3004 | lineNr | |
2746 super |
3005 |
2747 drawFromVisibleLine:startVisLineNr |
3006 |
2748 to:endVisLineNr |
3007 diffMode ifTrue:[ |
2749 with:fg |
3008 lineNr := self visibleLineToListLine:visLineNr. |
2750 and:bg. |
3009 (insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[ |
2751 |
3010 ^self colorInserted |
2752 "/ if in diffmode... |
3011 ]. |
2753 self redrawLines. |
3012 (changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[ |
2754 |
3013 ^self colorChanged |
2755 "Created: / 05-04-2010 / 12:08:38 / Jakub <zelenja7@fel.cvut.cz>" |
3014 ]. |
2756 "Modified: / 02-05-2010 / 18:46:04 / Jakub <zelenja7@fel.cvut.cz>" |
3015 (deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[ |
2757 ! |
3016 ^self colorDeleted |
2758 |
3017 ]. |
2759 drawLine:line fromX:x inVisible:visLineNr with:fg and:bg |
3018 ]. |
2760 |
3019 ^ bg |
2761 super |
3020 |
2762 drawLine:line |
3021 "Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2763 fromX:x |
3022 ! |
2764 inVisible:visLineNr |
3023 |
2765 with:fg |
3024 drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
2766 and:bg. |
3025 "draw a visible line range in fg/bg" |
2767 |
3026 |
2768 "/ if in diffmode... |
3027 diffMode ifFalse:[ |
2769 self redrawLines. |
3028 super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg. |
|
3029 ^self. |
|
3030 ]. |
|
3031 |
|
3032 startVisLineNr to: endVisLineNr do:[:visLineNr| |
|
3033 self drawVisibleLine: visLineNr with:fg and:bg |
|
3034 ] |
|
3035 |
|
3036 "Modified: / 15-12-1999 / 23:19:39 / cg" |
|
3037 "Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3038 ! |
|
3039 |
|
3040 drawLine:line fromX:x inVisible:visLineNr with:fg and:bg |
|
3041 super |
|
3042 drawLine:line |
|
3043 fromX:x |
|
3044 inVisible:visLineNr |
|
3045 with:fg |
|
3046 and:(self backgroundForVisibleLine:visLineNr default:bg). |
2770 |
3047 |
2771 "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>" |
3048 "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>" |
2772 "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>" |
3049 "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>" |
2773 ! |
3050 "Modified: / 17-03-2012 / 10:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2774 |
3051 ! |
2775 drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg |
3052 |
2776 |
3053 drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg |
2777 super |
3054 super |
2778 drawLine:lineStringArg |
3055 drawLine:lineStringArg |
2779 inVisible:visLineNr |
3056 inVisible:visLineNr |
2780 col:col |
3057 col:col |
2781 with:fg |
3058 with:fg |
2782 and:bg. |
3059 and:(self backgroundForVisibleLine:visLineNr default:bg). |
2783 |
|
2784 "/ if in diffmode... |
|
2785 self redrawLines. |
|
2786 |
3060 |
2787 "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>" |
3061 "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>" |
2788 "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>" |
3062 "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>" |
2789 ! |
3063 "Modified: / 17-03-2012 / 10:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2790 |
3064 ! |
2791 drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg |
3065 |
2792 |
3066 drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg |
2793 super |
3067 super |
2794 drawLine:lineStringArg |
3068 drawLine:lineStringArg |
2795 inVisible:visLineNr |
3069 inVisible:visLineNr |
2796 from:startCol |
3070 from:startCol |
2797 to:endColOrNil |
3071 to:endColOrNil |
2798 with:fg |
3072 with:fg |
2799 and:bg. |
3073 and:(self backgroundForVisibleLine:visLineNr default:bg). |
2800 |
|
2801 "/ if in diffmode... |
|
2802 self redrawLines. |
|
2803 |
3074 |
2804 "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>" |
3075 "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>" |
2805 "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>" |
3076 "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>" |
2806 ! |
3077 "Modified: / 17-03-2012 / 10:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2807 |
3078 ! |
2808 drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg |
3079 |
2809 |
3080 drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg |
2810 super |
3081 super |
2811 drawLine:lineString |
3082 drawLine:lineString |
2812 inVisible:visLineNr |
3083 inVisible:visLineNr |
2813 from:startCol |
3084 from:startCol |
2814 with:fg |
3085 with:fg |
2815 and:bg. |
3086 and:(self backgroundForVisibleLine:visLineNr default:bg). |
2816 |
|
2817 "/ if in diffmode... |
|
2818 self redrawLines. |
|
2819 |
3087 |
2820 "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>" |
3088 "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>" |
2821 "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>" |
3089 "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>" |
2822 ! |
3090 "Modified: / 17-03-2012 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2823 |
3091 ! |
2824 drawVisibleLine:visLineNr with:fg and:bg |
3092 |
2825 super |
3093 drawVisibleLine:visLineNr with:fg and:bg |
2826 drawVisibleLine:visLineNr |
3094 super |
2827 with:fg |
3095 drawVisibleLine:visLineNr |
2828 and:bg. |
3096 with:fg |
2829 |
3097 and:(self backgroundForVisibleLine:visLineNr default:bg). |
2830 gutterView redrawVisibleLine:visLineNr. |
|
2831 |
|
2832 "/ if in diffmode... |
|
2833 self redrawLines. |
|
2834 |
3098 |
2835 "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>" |
3099 "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>" |
2836 "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>" |
3100 "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>" |
|
3101 "Modified: / 17-03-2012 / 10:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2837 ! |
3102 ! |
2838 |
3103 |
2839 redraw |
3104 redraw |
2840 "/ thisContext fullPrintAll. |
3105 "/ thisContext fullPrintAll. |
2841 super redraw. |
3106 super redraw. |
2847 "redraw diff lines" |
3112 "redraw diff lines" |
2848 |
3113 |
2849 |i pom| |
3114 |i pom| |
2850 |
3115 |
2851 diffMode ifFalse:[^self]. |
3116 diffMode ifFalse:[^self]. |
|
3117 true ifTrue:[^self]. |
|
3118 |
2852 |
3119 |
2853 pom := self hasSelection. |
3120 pom := self hasSelection. |
2854 (pom) ifTrue:[ ^ self. ]. |
3121 (pom) ifTrue:[ ^ self. ]. |
2855 |
3122 |
2856 i := 1. |
3123 i := 1. |
2857 [ |
3124 [ |
2858 i <= (deletedLines size) |
3125 i <= (deletedLines size) |
2859 ] whileTrue:[ |
3126 ] whileTrue:[ |
2860 ((deletedLines at:i) > 0) ifTrue:[ |
3127 ((deletedLines at:i) > 0) ifTrue:[ |
2861 super |
3128 super |
2862 drawVisibleLine:(deletedLines at:i) |
3129 drawVisibleLine:(deletedLines at:i) |
2863 with:fgColor |
3130 with:fgColor |
2864 and:self colorDeleted. |
3131 and:self colorDeleted. |
2865 ]. |
3132 ]. |
2866 i := i + 1. |
3133 i := i + 1. |
2867 ]. |
3134 ]. |
2868 i := 1. |
3135 i := 1. |
2869 [ |
3136 [ |
2870 i <= (insertedLines size) |
3137 i <= (insertedLines size) |
2871 ] whileTrue:[ |
3138 ] whileTrue:[ |
2872 ((insertedLines at:i) > 0) ifTrue:[ |
3139 ((insertedLines at:i) > 0) ifTrue:[ |
2873 super |
3140 super |
2874 drawVisibleLine:(insertedLines at:i) |
3141 drawVisibleLine:(insertedLines at:i) |
2875 with:fgColor |
3142 with:fgColor |
2876 and:self colorInserted. |
3143 and:self colorInserted. |
2877 ]. |
3144 ]. |
2878 i := i + 1. |
3145 i := i + 1. |
2879 ]. |
3146 ]. |
2880 i := 1. |
3147 i := 1. |
2881 [ |
3148 [ |
2882 i <= (changedLines size) |
3149 i <= (changedLines size) |
2883 ] whileTrue:[ |
3150 ] whileTrue:[ |
2884 ((changedLines at:i) > 0) ifTrue:[ |
3151 ((changedLines at:i) > 0) ifTrue:[ |
2885 super |
3152 super |
2886 drawVisibleLine:(changedLines at:i) |
3153 drawVisibleLine:(changedLines at:i) |
2887 with:fgColor |
3154 with:fgColor |
2888 and:self colorChanged. |
3155 and:self colorChanged. |
2889 ]. |
3156 ]. |
2890 i := i + 1. |
3157 i := i + 1. |
2891 ]. |
3158 ]. |
2892 |
3159 |
2893 "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>" |
3160 "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>" |
2894 "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>" |
3161 "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>" |
2895 "Modified: / 08-04-2011 / 20:52:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3162 "Modified: / 17-03-2012 / 09:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2896 ! ! |
3163 ! ! |
2897 |
3164 |
2898 !CodeView2::TextView methodsFor:'editing'! |
3165 !CodeView2::TextView methodsFor:'editing'! |
2899 |
3166 |
2900 contentsChanged |
3167 contentsChanged |
3197 | lang | |
3464 | lang | |
3198 lang := codeView language. |
3465 lang := codeView language. |
3199 "Bit hacky here, should ask language some language toolbox |
3466 "Bit hacky here, should ask language some language toolbox |
3200 for formatting helper, that should do it..." |
3467 for formatting helper, that should do it..." |
3201 (lang notNil and:[lang isSmalltalk]) ifTrue:[ |
3468 (lang notNil and:[lang isSmalltalk]) ifTrue:[ |
3202 | line lineNo indent | |
3469 | line lineNo indent | |
3203 lineNo := lineNr. |
3470 lineNo := lineNr. |
3204 [lineNo ~~ 1] whileTrue:[ |
3471 [lineNo ~~ 1] whileTrue:[ |
3205 lineNo := lineNo - 1. |
3472 lineNo := lineNo - 1. |
3206 line := self listAt:lineNo. |
3473 line := self listAt:lineNo. |
3207 |
3474 |
3208 line notNil ifTrue:[ |
3475 line notNil ifTrue:[ |
3209 indent := line indexOfNonSeparatorStartingAt:1. |
3476 indent := line indexOfNonSeparatorStartingAt:1. |
3210 "beggining of block" |
3477 "beggining od block" |
3211 line notEmptyOrNil ifTrue:[ |
3478 line notEmptyOrNil ifTrue:[ |
3212 line last == $[ ifTrue:[ |
3479 line last == $[ ifTrue:[ |
3213 indent := indent + 4. |
3480 indent := indent + 4. |
3214 ] ifFalse:[ |
3481 ] ifFalse:[ |
3215 "end of block args" |
3482 "end of block args" |
3216 (line last == $| and: [line includes: $[]) ifTrue:[ |
3483 (line last == $| and: [line includes: $[]) ifTrue:[ |
3217 indent := indent + 4. |
3484 indent := indent + 4. |
3218 ] |
3485 ] |
3219 ]. |
3486 ]. |
3220 ]. |
3487 ]. |
3221 indent ~~ 0 ifTrue:[ |
3488 indent ~~ 0 ifTrue:[ |
3222 ^ indent - 1 |
3489 ^ indent - 1 |
3223 ] |
3490 ] |
3224 ] |
3491 ] |
3225 ]. |
3492 ]. |
3226 ^0. |
3493 ^0. |
3227 ]. |
3494 ]. |
3228 ^super leftIndentForLine:lineNr |
3495 ^super leftIndentForLine:lineNr |
3229 |
3496 |
3230 "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3497 "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3231 ! ! |
3498 ! ! |