Skip to content

Commit fdd4a7f

Browse files
committed
fixed dirty change detection
1 parent 10355fa commit fdd4a7f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: handler/sourcemapper/ino.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ func (s *InoMapper) ApplyTextChange(inoURI lsp.DocumentURI, inoChange lsp.TextDo
180180
s.CppText.Text = newText
181181
s.CppText.Version++
182182

183+
if _, is := s.inoPreprocessed[s.toIno[cppRange.Start.Line]]; is {
184+
dirty = true
185+
}
186+
183187
// Update line references
184188
for deletedLines > 0 {
185189
dirty = dirty || s.deleteCppLine(cppRange.Start.Line)
@@ -189,9 +193,6 @@ func (s *InoMapper) ApplyTextChange(inoURI lsp.DocumentURI, inoChange lsp.TextDo
189193
for addedLines > 0 {
190194
dirty = dirty || s.addInoLine(cppRange.Start.Line)
191195
}
192-
if _, is := s.cppPreprocessed[cppRange.Start.Line]; is {
193-
dirty = true
194-
}
195196
return
196197
}
197198

0 commit comments

Comments
 (0)