Tools__TextDiff3Tool.st
branchjv
changeset 15950 23be8cf85415
parent 15724 c2b9162d087d
child 16617 69e7de1ef22f
equal deleted inserted replaced
15937:b79f5d644b9a 15950:23be8cf85415
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 2006 by eXept Software AG
     2  COPYRIGHT (c) 2006 by eXept Software AG
     5               All Rights Reserved
     3               All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
    22 	poolDictionaries:''
    20 	poolDictionaries:''
    23 	category:'Interface-Diff'
    21 	category:'Interface-Diff'
    24 !
    22 !
    25 
    23 
    26 CodeViewService subclass:#MergeService
    24 CodeViewService subclass:#MergeService
    27 	instanceVariableNames:'dataHolder data sectionIntervalHolder'
    25 	instanceVariableNames:'dataHolder data sectionIntervalHolder ignoreLinesModifiedFromTo'
    28 	classVariableNames:''
    26 	classVariableNames:''
    29 	poolDictionaries:''
    27 	poolDictionaries:''
    30 	privateIn:TextDiff3Tool
    28 	privateIn:TextDiff3Tool
    31 !
    29 !
    32 
    30 
  1034 
  1032 
  1035     textView isNil ifTrue:[ 
  1033     textView isNil ifTrue:[ 
  1036         ^ self  "/not yet registered
  1034         ^ self  "/not yet registered
  1037     ]. 
  1035     ]. 
  1038     data isNil ifTrue:[
  1036     data isNil ifTrue:[
  1039         textView list: #().
  1037         textView list: StringCollection new.
  1040         ^self.
  1038         ^self.
  1041     ].
  1039     ].
  1042 
  1040 
  1043     "/Collect conflicted lines"
  1041     "/Collect conflicted lines"
  1044     changed := data listInfos 
  1042     changed := data listInfos 
  1045                 select:[:info|info isConflict]
  1043                 select:[:info|info isConflict]
  1046                 thenCollect:[:info|info line].
  1044                 thenCollect:[:info|info line].
  1047 
  1045     [ 
  1048     textView changedLines: changed.
  1046         ignoreLinesModifiedFromTo := true.    
  1049     textView diffMode: true.
  1047         textView changedLines: changed.
  1050     textView list: data list.
  1048         textView diffMode: true.
       
  1049         textView list: data list.
       
  1050     ] ensure:[ 
       
  1051         ignoreLinesModifiedFromTo := false.
       
  1052     ].
  1051     textView invalidate.
  1053     textView invalidate.
  1052     gutterView invalidate.
  1054     gutterView invalidate.
  1053 
  1055 
  1054     "Created: / 19-03-2012 / 12:41:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1056     "Created: / 19-03-2012 / 12:41:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1057     "Modified: / 16-11-2015 / 13:16:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1055 !
  1058 !
  1056 
  1059 
  1057 dataHolderChanged
  1060 dataHolderChanged
  1058 
  1061 
  1059     data notNil ifTrue:[
  1062     data notNil ifTrue:[
  1176     "Created: / 03-04-2012 / 19:23:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1179     "Created: / 03-04-2012 / 19:23:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1177 !
  1180 !
  1178 
  1181 
  1179 linesModifiedFrom: start to: end
  1182 linesModifiedFrom: start to: end
  1180 
  1183 
       
  1184     ignoreLinesModifiedFromTo ifTrue:[ ^ self ].
  1181     start to: end do:[:i|
  1185     start to: end do:[:i|
  1182         (data listInfos at:i) resolution: #Merged.
  1186         (data listInfos at:i) resolution: #Merged.
  1183     ].
  1187     ].
  1184     gutterView invalidate.
  1188     gutterView invalidate.
  1185 
  1189 
  1186     "Created: / 06-07-2011 / 17:14:36 / jv"
  1190     "Created: / 06-07-2011 / 17:14:36 / jv"
  1187     "Created: / 20-03-2012 / 22:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1191     "Created: / 20-03-2012 / 22:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1192     "Modified: / 16-11-2015 / 12:36:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1193 ! !
       
  1194 
       
  1195 !TextDiff3Tool::MergeService methodsFor:'initialization'!
       
  1196 
       
  1197 initialize
       
  1198     "Invoked when a new instance is created."
       
  1199     super initialize.
       
  1200     ignoreLinesModifiedFromTo := false.
       
  1201 
       
  1202     "Created: / 16-11-2015 / 12:36:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1188 ! !
  1203 ! !
  1189 
  1204 
  1190 !TextDiff3Tool::MergeService methodsFor:'registering'!
  1205 !TextDiff3Tool::MergeService methodsFor:'registering'!
  1191 
  1206 
  1192 registerIn: aCodeView
  1207 registerIn: aCodeView