Backspace sends DEL instead of ^H.
[spft.git] / ElasticTabs.h
blob8c0978557c86a8e04d006366405e7538e7415f84
1 #ifndef ElasticTabs_h
2 #define ElasticTabs_h
4 #include <vector>
5 #include <stdint.h>
8 class ElasticTabs {
9 public:
10 ElasticTabs(int num_right_columns_in) :
11 num_right_columns(num_right_columns_in),
12 reference_count(0), is_dirty(false), first_dirty_line(INT64_MAX)
15 std::vector<int> column_widths;
16 int num_right_columns;
17 int reference_count;
19 int num_columns() { return column_widths.size(); }
21 void acquire() { reference_count += 1; }
22 void release() {
23 if (--reference_count <= 0)
24 delete this;
27 // Dirtiness.
28 bool is_dirty;
29 int64_t first_dirty_line;
30 void undirtify() {
31 is_dirty = false;
32 first_dirty_line = INT64_MAX;
37 #endif // ElasticTabs_h