@@ -110,12 +110,6 @@ BlameListView = React.createClass
110
110
else
111
111
" translate(0px, #{ - scrollTop} px)"
112
112
113
- componentWillMount : ->
114
- # kick off async request for blame data
115
- @ loadBlame ()
116
- @ editor ().on ' contents-modified' , @contentsModified
117
- @ editor ().buffer .on ' saved' , @saved
118
-
119
113
loadBlame : ->
120
114
@ setState loading : true
121
115
@props .projectBlamer .blame @ editor ().getPath (), (err , data ) =>
@@ -131,14 +125,21 @@ BlameListView = React.createClass
131
125
dirty : false
132
126
annotations : data
133
127
128
+ # bound callback for Editor 'contents-modified' event
134
129
contentsModified : ->
135
130
return unless @ isMounted ()
136
131
@ setState dirty : true unless @state .dirty
137
132
133
+ # bound callback for Editor.buffer 'saved' event
138
134
saved : ->
139
135
return unless @ isMounted ()
140
136
@ loadBlame () if @state .visible and @state .dirty
141
137
138
+ # bound callback for Editor 'screen-lines-changed' event
139
+ screenLinesChanged : ->
140
+ console .log ' screen-lines-changed!'
141
+ return
142
+
142
143
toggle : ->
143
144
if @state .visible
144
145
@ setState visible : false
@@ -151,9 +152,17 @@ BlameListView = React.createClass
151
152
# blame gutter.
152
153
@ scrollbar ().on ' scroll' , @matchScrollPosition
153
154
155
+ componentWillMount : ->
156
+ # kick off async request for blame data
157
+ @ loadBlame ()
158
+ @ editor ().on ' contents-modified' , @contentsModified
159
+ @ editor ().on ' screen-lines-changed' , @screenLinesChanged
160
+ @ editor ().buffer .on ' saved' , @saved
161
+
154
162
componentWillUnmount : ->
155
163
@ scrollbar ().off ' scroll' , @matchScrollPosition
156
164
@ editor ().off ' contents-modified' , @contentsModified
165
+ @ editor ().off ' screen-lines-changed' , @screenLinesChanged
157
166
@ editor ().buffer .off ' saved' , @saved
158
167
159
168
# Makes the view arguments scroll position match the target elements scroll
0 commit comments