File: document.cpp

package info (click to toggle)
tuiwidgets 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,852 kB
  • sloc: cpp: 70,959; python: 655; sh: 39; makefile: 24
file content (15 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <Tui/ZDocument.h>
#include <Tui/ZDocumentCursor.h>
#include <Tui/ZTextMetrics.h>

void exampleCursor(Tui::ZTextMetrics textMetrics, Tui::ZDocument &doc) {
// snippet-start
    Tui::ZDocumentCursor cursor{&doc, [textMetrics, &doc](int line, bool wrappingAllowed) {
            Tui::ZTextLayout lay(textMetrics, doc.line(line));
            // <your custom configuration here>
            lay.doLayout(65000);
            return lay;
        }
    };
// snippet-end
}