Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
20
third-party/vendor/text_lines/README.md
vendored
Normal file
20
third-party/vendor/text_lines/README.md
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# text_lines
|
||||
|
||||
[](https://crates.io/crates/text_lines)
|
||||
|
||||
Information about lines of text in a string.
|
||||
|
||||
```rust
|
||||
use text_lines::TextLines;
|
||||
|
||||
let text = "Line 1\n\tLine 2";
|
||||
let info = TextLines::new(&text); // defaults to an indent width of 4
|
||||
|
||||
let line_index = info.line_index(9); // 1
|
||||
let line_and_column = info.line_and_column_index(9); // 1, 2
|
||||
let byte_index = info.byte_index(&line_and_column); // 9
|
||||
let line_and_column_display = info.line_and_column_display(9); // 2, 6
|
||||
|
||||
let info = TextLines::with_indent_width(&text, 2);
|
||||
let line_and_column_display = info.line_and_column_display(9); // 2, 4
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue