aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
AgeCommit message (Collapse)Author
2018-04-08Only load the plugin onceTeddy Wing
2018-04-08Move functions to autoload/Teddy Wing
Now that the plugin works and I'm done with the main development, move everything from `plugin/` to `autoload/`.
2018-04-08Echo tabs with "Tab page X" lines highlighted in the "Title" groupTeddy Wing
Makes the "Tab page X" lines appear in the same colour as they usually do when using the `:tabs` command.
2018-04-07s:MatchString(): Reuse `s:IsTabPageLine()`Teddy Wing
I previously extracted this check to `s:IsTabPageLine()` in order to use it in `s:FilterTabPageElements()`. Eliminate it from `s:MatchString()` now and reuse the function.
2018-04-07Remove old commented codeTeddy Wing
This was never really useful, just a holdover from very early development (copied from LsGrep and modified a bit).
2018-04-07Remove debug `echo`sTeddy Wing
2018-04-07Output filtered tabsTeddy Wing
2018-04-07s:FilterTabPageElements(): Clean up commentsTeddy Wing
Remove development comments. And a debug `echo`. Add more descriptive comments for the different steps.
2018-04-07s:FilterTabPageElements(): Filter empty "Tab page X" elementsTeddy Wing
This function now works the way I want it to, removing the "Tab page X" headers with no files under them from the `:tabs` list. We do this by building a list of indexes of those "Tab page X" elements and then removing them from the original list. The removal happens in reverse so we don't mess up the indexes by removing from left to right.
2018-04-07Create `s:FilterTabPageElements()`Teddy Wing
Add a function that will filter out "Tab page 10" elements that don't have any files under them. Incomplete for now but I'm committing what I have here because it looks like I'm going to have to change things around just a bit. At the moment, the function will take the list of matched `:tabs` lines, make a list of the indexes of the "Tab page X" elements, and finally remove the empty "Tab page X" elements from that list, leaving only the indexes of those with files under them. Instead what I think I need is a list of the "Tab page X" indexes that don't have files so I can remove these from the list.
2018-04-07s:MatchString(): Fix line continuation problemTeddy Wing
I had had trouble with the line continuation in this function, but it turns out what I had written the first time was fine. It's just that I was sourcing my plugin incorrectly and that's the reason why I was getting errors. Before I was doing: $ vim --cmd 'so ~/Documents/Development/vim-tabs-grep/plugin/tabs_grep.vim' -p bin/imagebin.ca.sh bin/fucking-orange.sh functions/frequency w3m-tabs.exp Using the `-c` flag instead completely fixed the problem: $ vim -c 'so ~/Documents/Development/vim-tabs-grep/plugin/tabs_grep.vim' -p bin/imagebin.ca.sh bin/fucking-orange.sh functions/frequency w3m-tabs.exp Revert back to the original code in this function.
2018-04-07tabs_grep.vim: Trouble with line continuations; reorder argumentsTeddy Wing
`s:MatchString()` needs to have the search string as its first argument, because that's how it will get passed in when referenced above as: call filter(tabs, function('s:MatchString', [a:search])) Also had some trouble getting the line continuation to work on the `return`, so had a few experiments messing with that trying to get it to work.
2018-04-07tabs_grep.vim: Split `:tabs` output on `\n`Teddy Wing
Otherwise it splits on spaces, and I end up with word elements in my list instead of line elements.
2018-04-07Initial ideas for TabsGrepTeddy Wing
Repurposed some code from my LsGrep plugin. We grab output from `:tabs` and run it through a filter to get only the matching file names. We also want to include the "Tab page 1" lines, so these need to be filtered specially.