aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RunStyles.cxx
AgeCommit message (Collapse)AuthorFilesLines
3 daysadded a dummy RunStyles.cxxHEADsciteco-rel-5-5-7Robin Haberkorn1-0/+0
Allows building Scinterm without removing references to RunStyles.o. 63cee0686964d789e6b53406abcc0bdbed50206a, which removed RunStyles.cxx, is still experimental and not yet merged upstream.
3 daysimplicitly instantiate RunStyles: support ptrdiff_t if it has the same ↵Robin Haberkorn1-327/+0
storage size as int, but does *not* alias it * This is the case e.g. on NetBSD 10 for ARMv6 where Sci::Position == ptrdiff_t == long int, but obviously for other platforms as well, where it causes "invalid conversion" and "undefined symbol" errors. Scintilla was testing for aliasability by comparing the storage size with sizeof() or PTRDIFF_MAX == INT_MAX at the preprocessor level. This was fundamentally flawed. * In LineVector<T>::InsertLines() we are now using the C++17 construct std::is_convertible_v<From*,To*> instead. * We need RunStyles<ptrdiff_t> as well on the affected platforms. AFAIK this is impossible to test for in a constant expression that can be used with the preprocessor. A workaround has been added previously for Haiku: https://groups.google.com/g/scintilla-interest/c/xPXquJUIXo8/m/BLXBpTTgBwAJ The workaround is not very robust, as probably nobody guarantees that ptrdiff_t never aliases on Haiku. If it does, you will suddenly get errors about duplicate template instantiations. Quite possibly, the explicit instantiations of RunStyles were wrong on certain 32-bit Linux variants as well. * We could have tried to explicitly instantiate RunStyles for all scalar types that could possibly be behind ptrdiff_t. Unfortunately, it would result in "possible loss of data" warnings on MSVC. Instead, we now implicitly instantiate RunStyles.
3 daysRevert "support ptrdiff_t if it has the same storage size as int, but does ↵Robin Haberkorn1-5/+4
*not* alias it" This reverts commit 0953ffeee80abdd8e79ddacc7066eb02c78968e7.
2025-08-26support ptrdiff_t if it has the same storage size as int, but does *not* ↵Robin Haberkorn1-4/+5
alias it * This is the case e.g. on NetBSD 10 for ARMv6 where Sci::Position == ptrdiff_t == long int, but obviously for other platforms as well, where it causes "invalid conversion" and "undefined symbol" errors. Scintilla was testing for aliasability by comparing the storage size with sizeof() or PTRDIFF_MAX == INT_MAX at the preprocessor level. This was fundamentally flawed. * In LineVector<T>::InsertLines() we are now using the C++17 construct std::is_convertible_v<From*,To*> instead. * We need RunStyles<ptrdiff_t> as well on the affected platforms. AFAIK this is impossible to test for in a constant expression that can be used with the preprocessor. A workaround has been added previously for Haiku: https://groups.google.com/g/scintilla-interest/c/xPXquJUIXo8/m/BLXBpTTgBwAJ The workaround is not very robust, as probably nobody guarantees that ptrdiff_t never aliases on Haiku. If it does, you will suddenly get errors about duplicate template instantiations. Instead we now instantiate RunStyles for all scalar types that could possibly be behind ptrdiff_t. This will always be more than what is required on any particular platform, but the linker should eliminate unused symbols.
2024-12-02Improve performance of simple case where FillRange just inserts two entries andNeil1-1/+18
does not need to split, merge, or delete runs. This avoids multiple binary searches and is a significant improvement for situations such as marking large numbers of search matches in a huge document.
2024-12-02Remove explicit initialization which is identical to default initialization.Neil1-5/+2
Remove constructor argument which is same as default. Shorten code and avoid else.
2022-07-29Apply rule-of-zero to delete standard methods where possible as handled byNeil1-4/+0
contained types. This allows flexibility as most lower-level data types can be moved and SplitVector and Partitioning of non-move-only types may be copied. CellBuffer still needs destructor due to incomplete type so retains all standard operations.
2022-07-29Flatten Partitioning and RunStyles to avoid a level of indirection by containingNeil1-55/+55
SplitVector and Partitioning directly instead of using std::unique_ptr. This will enable more value semantics and reduces potential memory allocation failure scenarios.
2022-07-28Use extra consts to avoid 32 to 64-bit widening warnings in headers.Neil1-2/+4
This change wouldn't be worthwhile in implementation files but warnings in headers obscure more important diagnostics.
2022-02-16Bug [#2315] Fix undefined macros. Fixes key map for GTK on macOS and Haiku ↵Neil1-1/+1
build.
2021-05-24Define C++ version of the Scintilla API in ScintillaTypes.h, ScintillaMessages.hNeil1-6/+5
and ScintillaStructures.h using scoped enumerations. Use these headers instead of Scintilla.h internally. External definitions go in the Scintilla namespace and internal definitio0ns in Scintilla::Internal.
2021-03-18std::optional is a basic vocabulary type that may be used widely so includeNeil1-0/+1
almost everywhere.
2021-03-18Move assert and debug trace functions into their own header Debugging.h.Neil1-2/+1
PLATFORM_ASSERT is used in data structure headers which led to including graphics and windowing APIs in data structure modules.
2021-03-17Extract geometry and colour definitions from Platform.h into src/Geometry.h.Neil1-0/+1
2019-01-06Bug [#2068]. Fix some clang-tidy warnings.Zufu Liu1-2/+2
2018-07-31Define PLAT_HAIKU and use to avoid a reported compilation problem on 32-bitNeil1-1/+1
Haiku where ptrdiff_t and int are the same size but different types.
2018-05-14Include <string_view> to allow future use in Platform interface and Unicode.Neil1-0/+1
2018-04-21Use noexcept in basic data structures where reasonable.Neil1-10/+10
Declare the standard member functions in more classes
2018-04-20Stop "duplicate explicit instantiation" error on g++ 32-bit where int andNeil1-0/+4
ptrdiff_t are the same type.
2018-04-17Add SC_DOCUMENTOPTION_TEXT_LARGE option for documents larger than 2 GigaBytes.Neil1-0/+2
This option is provisional and experimental.
2018-03-27Return a FillResult struct from RunStyles::FillRange instead of modifyingNeil1-8/+9
arguments as that is clumsy when converting types.
2018-03-09Use Position/Line/int more accurately in preparation for large documents.Neil1-0/+1
2018-03-01Use make_unique in preference to new.Neil1-4/+4
From Effective Modern C++ Item 21.
2018-02-01Templatize RunStyles so it can be over ranges of different types and containNeil1-48/+72
different style types. Currently only instantiated over <int, int>.
2018-02-01Templatize Partitioning so it can hold different types.Neil1-2/+2
2017-09-11The Scintilla namespace is always active for internal symbols and for the lexerNeil1-2/+0
interfaces ILexer4 and IDocument.
2017-05-21Make SplitVector work with move-only types like unique_ptr.Neil1-0/+1
Provide InsertEmpty and both const and non-const reference returning operator[]. Add and fix comments.
2017-05-10Use unique_ptr fpr Partitioning, RunStyles, SparseVector, PositionCache andNeil1-12/+4
Document.
2017-04-22Include <memory> for std::unique_ptr.Neil1-0/+1
2017-04-06Added const where possible.Neil1-5/+5
2017-04-01Standardize on C++ headers, remove headers that aren't needed and add <cstddef>Neil1-4/+5
where it may be needed in the future.
2015-07-27Add Position.h as a place-holder and to allow #include "Position.h" in source.Neil1-0/+1
2013-07-21Normalising order of language headers.Neil1-2/+2
2013-07-21Make compile with libc++ on OS X.Neil1-0/+1
2013-05-24Made methods const where they can be and are logically const as well.nyamatongwe1-4/+4
2013-04-15Existing code fills 0 length ranges and ranges after document end so simplynyamatongwe1-2/+2
return instead of throwing exceptions.
2013-04-15RunStyles can be corrupted by filling 0 length ranges and ranges that go ↵nyamatongwe1-0/+36
past end so throw std::invalid_argument exceptions for these conditions. Provide a Check method to validate the consistency of a RunStyles and throw std::runtime_error if corruption is detected.
2012-09-12Fix bug where removing all characters from indicator at end of document didnyamatongwe1-0/+1
not remove that run causing iteration over the indicator to hang.
2011-06-07Add Find method on RunStyles.nyamatongwe1-0/+15
2011-06-07Fix bug with extra partition created when range filled.nyamatongwe1-0/+2
2011-06-07Add accessor to RunStyles for number of runs so Decoration can use public API.nyamatongwe1-1/+5
Make RunStyles internal methods private. RunFromPosition is const so marker as const.
2011-06-07Make SCN_NEEDSHOWN notification work when word wrap is enabled.nyamatongwe1-0/+11
This fixes the last remaining issue from bug #3291579. From Marko Njezic
2010-12-30Avoid redraws when setting an indicator over positions where it is already set.nyamatongwe1-1/+3
From Tino Weinkauf.
2008-01-19Made som emethods const.nyamatongwe1-2/+2
2007-07-25Changed ContractionState data structure to be more efficient by not onlynyamatongwe1-0/+5
modifying data near an insertion or deletion when there is good locality of modification.
2007-06-12Fixed bug where setting the same range twice to the same value resultednyamatongwe1-7/+9
in rest of document being set.
2007-06-09Fixed bug when setting a range where the start of the range was already anyamatongwe1-3/+5
run start.
2007-06-01integrate OS X support for scintilla. a big patch with a little commit ↵scaraveo1-0/+4
message :) - now uses namespaces (optionally for non-os x) to avoid conflicts with OS X libraries - several fixes in the OS X layer since the branch was commited in 2005 - used in Komodo since 2005, so pretty stable
2007-04-19Optimized indicator changing with separate SC_MOD_CHANGEINDICATORnyamatongwe1-18/+27
notification flag.
2007-04-07More decoration code, with modifications reported from document to viewsnyamatongwe1-3/+10
although this isn't optimal. Some checking for null changes. Messages documented. Methods for changing indicators in Accessor so can be used by lexers.