summaryrefslogtreecommitdiff
path: root/src/line_modification.hh
blob: 7c21503cedf7cf2d63b094f1016c3d59c6dd343f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef line_change_watcher_hh_INCLUDED
#define line_change_watcher_hh_INCLUDED

#include "units.hh"
#include "utils.hh"
#include "vector.hh"

namespace Kakoune
{

class Buffer;

struct LineModification
{
    LineCount old_line; // line position in the old buffer
    LineCount new_line; // new line position
    LineCount num_removed; // number of lines removed (including this one)
    LineCount num_added; // number of lines added (including this one)

    LineCount diff() const { return new_line - old_line + num_added - num_removed; }
};

Vector<LineModification> compute_line_modifications(const Buffer& buffer, size_t timestamp);

}

#endif // line_change_watcher_hh_INCLUDED