Commit Graph

11 Commits

Author SHA1 Message Date
dundargoc a1550dbf0a build: silence new clang-tidy warnings 2024-04-24 10:28:55 +02:00
dundargoc 0c120307ca refactor: eliminate cyclic includes 2023-12-20 19:52:02 +01:00
dundargoc 4880385809 build: adjust clang-tidy warning exclusion logic
Enable all clang-tidy warnings by default instead of disabling them.
This ensures that we don't miss useful warnings on each clang-tidy
version upgrade. A drawback of this is that it will force us to either
fix or adjust the warnings as soon as possible.
2023-11-20 20:05:43 +01:00
dundargoc 4d757bbfbb refactor: combine regexp files
regext_bt.c and regexp_nfa.c are inlined into regexp.c instead of
included as a header. This makes developer tools like clang-tidy and
clangd be able to understand the code better.
2023-11-05 11:48:42 +01:00
dundargoc 9f58867935 refactor(clang-tidy): ignore warnings from clang-tidy 17 2023-09-24 04:58:49 +02:00
bfredl b04286a187 feat(extmark): support proper multiline ranges
The removes the previous restriction that nvim_buf_set_extmark()
could not be used to highlight arbitrary multi-line regions

The problem can be summarized as follows: let's assume an extmark with a
hl_group is placed covering the region (5,0) to (50,0) Now, consider
what happens if nvim needs to redraw a window covering the lines 20-30.
It needs to be able to ask the marktree what extmarks cover this region,
even if they don't begin or end here.

Therefore the marktree needs to be augmented with the information covers
a point, not just what marks begin or end there. To do this, we augment
each node with a field "intersect" which is a set the ids of the
marks which overlap this node, but only if it is not part of the set of
any parent. This ensures the number of nodes that need to be explicitly
marked grows only logarithmically with the total number of explicitly
nodes (and thus the number of of overlapping marks).

Thus we can quickly iterate all marks which overlaps any query position
by looking up what leaf node contains that position. Then we only need
to consider all "start" marks within that leaf node, and the "intersect"
set of that node and all its parents.

Now, and the major source of complexity is that the tree restructuring
operations (to ensure that each node has T-1 <= size <= 2*T-1) also need
to update these sets. If a full inner node is split in two, one of the
new parents might start to completely overlap some ranges and its ids
will need to be moved from its children's sets to its own set.
Similarly, if two undersized nodes gets joined into one, it might no
longer completely overlap some ranges, and now the children which do
needs to have the have the ids in its set instead. And then there are
the pivots! Yes the pivot operations when a child gets moved from one
parent to another.
2023-09-12 10:38:23 +02:00
dundargoc 47638706a3
build: treat clang-tidy warnings as errors (#22238) 2023-02-12 17:41:54 +01:00
dundargoc 731cdde28e refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning.

Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
2022-11-06 11:44:10 +01:00
dundargoc 784e498c4a
refactor: clang-tidy fixes to silence clangd warning (#20683)
* refactor: readability-uppercase-literal-suffix

* refactor: readability-named-parameter

* refactor: bugprone-suspicious-string-compare

* refactor: google-readability-casting

* refactor: readability-redundant-control-flow

* refactor: bugprone-too-small-loop-variable

* refactor: readability-non-const-parameter

* refactor: readability-avoid-const-params-in-decls

* refactor: google-readability-todo

* refactor: readability-inconsistent-declaration-parameter-name

* refactor: bugprone-suspicious-missing-comma

* refactor: remove noisy or slow warnings
2022-10-21 20:47:44 +08:00
dundargoc 0a19c16778
build: fix incorrect clang-tidy identifier rules (#20650)
Also remove identifier rules that are C++ only.
2022-10-14 15:15:10 +02:00
kylo252 d5db93b8aa
build: add clang-tidy configuration file (#15601)
Add a project-style compliant clang-tidy configuration file in the root directory. This configuration will take priority over users own configuration files, so noisy warnings have been removed even though they may be useful, at least for the time being.
2022-10-12 10:49:53 +02:00