@@ -114,14 +114,7 @@ module.exports = SplitDiff =
114114 @editorSubscriptions .add editors .editor2 .onDidDestroy =>
115115 @ disable (true )
116116
117- # update diff on any settings change
118- @editorSubscriptions .add atom .config .onDidChange ' split-diff.ignoreWhitespace' , ({newValue, oldValue}) =>
119- @ updateDiff (editors)
120- @editorSubscriptions .add atom .config .onDidChange ' split-diff.diffWords' , ({newValue, oldValue}) =>
121- @ updateDiff (editors)
122- @editorSubscriptions .add atom .config .onDidChange ' split-diff.leftEditorColor' , ({newValue, oldValue}) =>
123- @ updateDiff (editors)
124- @editorSubscriptions .add atom .config .onDidChange ' split-diff.rightEditorColor' , ({newValue, oldValue}) =>
117+ @editorSubscriptions .add atom .config .onDidChange ' split-diff' , () =>
125118 @ updateDiff (editors)
126119
127120 # manually update diff if there are already two editors
@@ -156,6 +149,7 @@ module.exports = SplitDiff =
156149
157150 detailMsg = ' Ignore Whitespace: ' + @isWhitespaceIgnored
158151 detailMsg += ' \n Show Word Diff: ' + @isWordDiffEnabled
152+ detailMsg += ' \n Sync Horizontal Scroll: ' + @ getConfig (' syncHorizontalScroll' )
159153 atom .notifications .addInfo (' Split Diff Enabled' , {detail : detailMsg, dismissable : false })
160154
161155 # called by both diffPanes and the editor subscription to update the diff
@@ -165,6 +159,7 @@ module.exports = SplitDiff =
165159 @ clearDiff ()
166160 @isWhitespaceIgnored = @ getConfig (' ignoreWhitespace' )
167161 @isWordDiffEnabled = @ getConfig (' diffWords' )
162+ syncHorizontalScroll = @ getConfig (' syncHorizontalScroll' )
168163
169164 SplitDiffCompute = require ' ./split-diff-compute'
170165 computedDiff = SplitDiffCompute .computeDiff (editors .editor1 .getText (), editors .editor2 .getText (), @isWhitespaceIgnored )
@@ -176,7 +171,7 @@ module.exports = SplitDiff =
176171 if @isWordDiffEnabled
177172 @ highlightWordDiff (SplitDiffCompute, @linkedDiffChunks )
178173
179- @syncScroll = new SyncScroll (editors .editor1 , editors .editor2 )
174+ @syncScroll = new SyncScroll (editors .editor1 , editors .editor2 , syncHorizontalScroll )
180175 @syncScroll .syncPositions ()
181176
182177 # called by "Disable" command
0 commit comments