diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2021-08-20 11:11:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-20 11:11:24 -0400 |
| commit | a97af306c4e9c9a6fa7c886c0ffe3079822c5203 (patch) | |
| tree | f5e2b50a767e93618d0d8fdddb8a964c90633c8a /scratch/fast_split.lua | |
| parent | d6d28dbe324de9826a579155076873888169ba0f (diff) | |
feat(performance): Major performance improvements using async v2 from @oberblastmeister (#987)
* start: Working w/ async jobs
* short circuit to using bad finder if you pass writer.
Diffstat (limited to 'scratch/fast_split.lua')
| -rw-r--r-- | scratch/fast_split.lua | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/scratch/fast_split.lua b/scratch/fast_split.lua deleted file mode 100644 index 0c5ea88..0000000 --- a/scratch/fast_split.lua +++ /dev/null @@ -1,28 +0,0 @@ -local test_line = "/home/tj/hello/world.lua" - -local function fast_split(line, split) - -- local split_line = vim.split(line, split) - local areas = {} - - local processed = 1 - local line_length = #line + 1 - - local part, start - repeat - start = string.find(line, split, processed, true) or line_length - part = string.sub(line, processed, start - 1) - - if start - processed > 0 then - table.insert(areas, { - word = part, - offset = processed - }) - end - - processed = start + 1 - until start == line_length - - return areas -end - -print(vim.inspect(fast_split(test_line, '/'))) |
