Changeset View
Changeset View
Standalone View
Standalone View
src/buffer/katetextrange.h
Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Line(s) | 283 | private: | |||
---|---|---|---|---|---|
307 | * @param oldEndLine old end line of this range | 307 | * @param oldEndLine old end line of this range | ||
308 | * @param startLine start line to start looking for the range to remove | 308 | * @param startLine start line to start looking for the range to remove | ||
309 | * @param endLine end line of this range | 309 | * @param endLine end line of this range | ||
310 | */ | 310 | */ | ||
311 | void fixLookup(int oldStartLine, int oldEndLine, int startLine, int endLine); | 311 | void fixLookup(int oldStartLine, int oldEndLine, int startLine, int endLine); | ||
312 | 312 | | |||
313 | private: | 313 | private: | ||
314 | /** | 314 | /** | ||
315 | * Mark this range for later validity checking. | ||||
316 | */ | ||||
317 | void setValidityCheckRequired() | ||||
318 | { | ||||
319 | m_isCheckValidityRequired = true; | ||||
320 | } | ||||
321 | | ||||
322 | /** | ||||
323 | * Does this range need validity checking? | ||||
324 | * @return is checking required? | ||||
325 | */ | ||||
326 | bool isValidityCheckRequired() const | ||||
327 | { | ||||
328 | return m_isCheckValidityRequired; | ||||
329 | } | ||||
330 | | ||||
331 | /** | ||||
315 | * parent text buffer | 332 | * parent text buffer | ||
316 | * is a reference, and no pointer, as this must always exist and can't change | 333 | * is a reference, and no pointer, as this must always exist and can't change | ||
317 | */ | 334 | */ | ||
318 | TextBuffer &m_buffer; | 335 | TextBuffer &m_buffer; | ||
319 | 336 | | |||
320 | /** | 337 | /** | ||
321 | * Start cursor for this range, is a clever cursor | 338 | * Start cursor for this range, is a clever cursor | ||
322 | */ | 339 | */ | ||
Show All 28 Lines | |||||
351 | * Is this range's attribute only visible in views, not for example prints? | 368 | * Is this range's attribute only visible in views, not for example prints? | ||
352 | */ | 369 | */ | ||
353 | bool m_attributeOnlyForViews; | 370 | bool m_attributeOnlyForViews; | ||
354 | 371 | | |||
355 | /** | 372 | /** | ||
356 | * Will this range invalidate itself if it becomes empty? | 373 | * Will this range invalidate itself if it becomes empty? | ||
357 | */ | 374 | */ | ||
358 | bool m_invalidateIfEmpty; | 375 | bool m_invalidateIfEmpty; | ||
376 | | ||||
377 | /** | ||||
378 | * Should this range be validated? | ||||
379 | * Used by KateTextBlock to avoid multiple updates without costly hashing. | ||||
380 | * Reset by checkValidity(). | ||||
381 | */ | ||||
dhaumann: I would prefer an additional
inline void setValidityCheckRequired();
inline bool… | |||||
cullmann: That makes sense, will change that.
Looks nicer in the code, too. | |||||
382 | bool m_isCheckValidityRequired = false; | ||||
359 | }; | 383 | }; | ||
360 | 384 | | |||
361 | } | 385 | } | ||
362 | 386 | | |||
363 | #endif | 387 | #endif |
I would prefer an additional
We don't need a bool in the setter, since we always only mark dirty. And with these accessors, you could add a unit test (in dact, I would like to see one for this).
And instead of 'double' I suggest to use the term 'multiple' in the comment.