summaryrefslogtreecommitdiff
path: root/src/coord.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-09-09 19:35:54 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-09-09 19:42:57 +0100
commit50924944274d43149267cd9238625e40b46bbfeb (patch)
tree395366fa1159a5cffa760a4ae0ce98fd9604ee84 /src/coord.hh
parent7fc1564c0c15508a44abe1627002532d6ae52ae2 (diff)
Add support for target column preservation
Fixes #64
Diffstat (limited to 'src/coord.hh')
-rw-r--r--src/coord.hh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/coord.hh b/src/coord.hh
index f60be779..dbae5001 100644
--- a/src/coord.hh
+++ b/src/coord.hh
@@ -99,6 +99,19 @@ struct CharCoord : LineAndColumn<CharCoord, LineCount, CharCount>
: LineAndColumn(line, column) {}
};
+struct ByteCoordAndTarget : ByteCoord
+{
+ [[gnu::always_inline]]
+ constexpr ByteCoordAndTarget(LineCount line = 0, ByteCount column = 0, CharCount target = -1)
+ : ByteCoord(line, column), target(target) {}
+
+ [[gnu::always_inline]]
+ constexpr ByteCoordAndTarget(ByteCoord coord, CharCount target = -1)
+ : ByteCoord(coord), target(target) {}
+
+ CharCount target;
+};
+
}
#endif // coord_hh_INCLUDED