command-t.git
2 months agotest: attempt to unbreak CI main master
Greg Hurrell [Fri, 25 Feb 2022 17:14:27 +0000 (18:14 +0100)] 
test: attempt to unbreak CI

Because last couple of runs have failed with:

    line 1: bundle: command not found

I am not 100% sure `bundler` is the right package name to use, but this
post found via a web search for "ubuntu ruby bundler" suggests that it
might be:

    https://stackify.com/install-ruby-on-ubuntu-everything-you-need-to-get-going/

2 months agofix: teach file scanner to skip over badly encoded strings
Greg Hurrell [Fri, 25 Feb 2022 17:06:56 +0000 (18:06 +0100)] 
fix: teach file scanner to skip over badly encoded strings

This is motivated because I'm working in a repo checked out on a Linux
system where there is an intentionally badly encoded filename (a test
artifact). I gather I wouldn't see this on macOS because, if APFS is
anything like HFS/HFS+ was, it is very strict about things all being in
variant of Unicode Normal Form D -- you can't create such a file even if
you want to -- whereas most Linux filesystems just consider names to be
opaque strings of NUL-terminated bytes.

I couldn't find a bullet-proof reference to back my claim about HFS up,
but I did find this:

> The terms used in this Q&A, precomposed and decomposed, roughly
> correspond to Unicode Normal Forms C and D, respectively. However,
> most volume formats do not follow the exact specification for these
> normal forms. For example, HFS Plus (Mac OS Extended) uses a variant
> of Normal Form D in which U+2000 through U+2FFF, U+F900 through
> U+FAFF, and U+2F800 through U+2FAFF are not decomposed (this avoids
> problems with round trip conversions from old Mac text encodings).

Source: https://developer.apple.com/library/archive/qa/qa1173/_index.html

11 months agochore: update "master" references to "main"
Greg Hurrell [Mon, 7 Jun 2021 22:26:12 +0000 (00:26 +0200)] 
chore: update "master" references to "main"

Fear not that this will break anybody's existing clones, because I am
going to keep both branches in sync for the foreseeable future, using
hooks as described here:

    https://wincent.com/wiki/Migrating_the_Git_default_branch_from_master_to_main

14 months agodocs: update HISTORY section
Greg Hurrell [Sun, 14 Mar 2021 20:24:05 +0000 (21:24 +0100)] 
docs: update HISTORY section

14 months agofix: suppress signcolumn in match window signcolumn-off
Greg Hurrell [Sat, 13 Mar 2021 15:28:44 +0000 (16:28 +0100)] 
fix: suppress signcolumn in match window

Closes: https://github.com/wincent/command-t/issues/376
14 months agoMerge branch 'pull/378'
Greg Hurrell [Thu, 4 Mar 2021 20:21:15 +0000 (21:21 +0100)] 
Merge branch 'pull/378'

Closes: https://github.com/wincent/command-t/pull/378
* pull/378:
  chore: drop RR from Gemfile

14 months agochore: drop RR from Gemfile
Vít Ondruch [Thu, 4 Mar 2021 20:02:48 +0000 (21:02 +0100)] 
chore: drop RR from Gemfile

14 months agoMerge branch 'pull/377'
Greg Hurrell [Thu, 4 Mar 2021 19:50:58 +0000 (20:50 +0100)] 
Merge branch 'pull/377'

Closes: https://github.com/wincent/command-t/pull/377
* pull/377:
  test: fix CI setup

14 months agotest: fix CI setup
Vít Ondruch [Thu, 4 Mar 2021 18:21:50 +0000 (19:21 +0100)] 
test: fix CI setup

14 months agotest: correct workflows directory name
Greg Hurrell [Thu, 4 Mar 2021 18:35:26 +0000 (19:35 +0100)] 
test: correct workflows directory name

See: https://github.com/wincent/command-t/pull/377

14 months agoMerge branch 'pull/375' (additional commit)
Greg Hurrell [Thu, 4 Mar 2021 18:27:34 +0000 (19:27 +0100)] 
Merge branch 'pull/375' (additional commit)

This was a commit added to:

    https://github.com/wincent/command-t/pull/375

while I was reviewing/testing/merging it. So it comes in via this second
installment.

* pull/375:
  test: add CI

14 months agotest: add CI
Vít Ondruch [Thu, 4 Mar 2021 18:21:50 +0000 (19:21 +0100)] 
test: add CI

Original from:

    https://github.com/wincent/command-t/pull/375

14 months agoMerge branch 'pull/375'
Greg Hurrell [Thu, 4 Mar 2021 18:23:00 +0000 (19:23 +0100)] 
Merge branch 'pull/375'

Closes: https://github.com/wincent/command-t/pull/375
* pull/375:
  test: fix tests
  refactor: use rspec-mock for stubbing.

14 months agotest: fix tests
Greg Hurrell [Thu, 4 Mar 2021 18:20:43 +0000 (19:20 +0100)] 
test: fix tests

These are all probably very sensitive to environment (Ruby version etc),
and I haven't run them for a while, so just doing a duct-tape and
chicken-wire kind of fix to get everything green on my system.

Note that I "defanged" the BufferScanner tests which were failing and
were too complicated (too many mocks, so it is hard to be sure that they
verified anything at all) by effectively turning them into a
blinking-light demo that doesn't really do much.

With these changes:

    Finished in 0.10298 seconds (files took 0.11239 seconds to load)
    121 examples, 0 failures, 1 pending

14 months agorefactor: use rspec-mock for stubbing.
Vít Ondruch [Thu, 4 Mar 2021 12:53:36 +0000 (13:53 +0100)] 
refactor: use rspec-mock for stubbing.

This allows to remove `rr` dependency and therefore reduce dependency
chain.

23 months agoMerge branch 'pull/361'
Greg Hurrell [Tue, 2 Jun 2020 16:12:19 +0000 (18:12 +0200)] 
Merge branch 'pull/361'

Closes: https://github.com/wincent/command-t/pull/361
* pull/361:
  docs: update AUTHORS
  docs: tweak wording
  docs: add tips for compiling when using rvm and brew

23 months agodocs: update AUTHORS
Greg Hurrell [Tue, 2 Jun 2020 16:12:13 +0000 (18:12 +0200)] 
docs: update AUTHORS

23 months agodocs: tweak wording
Greg Hurrell [Tue, 2 Jun 2020 16:10:40 +0000 (18:10 +0200)] 
docs: tweak wording

23 months agodocs: add tips for compiling when using rvm and brew
Brendan Mulholland [Wed, 23 Oct 2019 15:16:11 +0000 (17:16 +0200)] 
docs: add tips for compiling when using rvm and brew

Homebrew now has ruby listed as a dependency for both vim and
macvim, which means there are version conflicts together with
RVM (and likely rbenv). I have confirmed that the comment at
https://github.com/wincent/command-t/issues/341#issuecomment-522216390
fixes this issue (for my computer running Catalina and macvim from
homebrew), and am adding these to the instructions so they are easier
for others to find.

2 years agochore: battle bit-rot in gem dependency graph
Greg Hurrell [Sat, 9 May 2020 17:37:07 +0000 (19:37 +0200)] 
chore: battle bit-rot in gem dependency graph

Because GitHub is nagging me:

    Upgrade nokogiri to version 1.10.8 or later. For example:

    gem "nokogiri", ">= 1.10.8"

    CVE-2020-7595

    moderate severity

    Vulnerable versions: < 1.10.8

    Patched version: 1.10.8

    xmlStringLenDecodeEntities in parser.c in libxml2 2.9.10 has an
    infinite loop in a certain end-of-file situation.  The Nokogiri
    RubyGem has patched it's vendored copy of libxml2 in order to
    prevent this issue from affecting nokogiri.

And this dependency brings me net negative value. I can just prepare
and upload releases manually, without mechanize. It's not like I do it
often anyway; anybody using pretty much any Vim plug-in nowadays just
points their plug-in manager at the `master` branch of a Git repo --
"releases" are almost meaningless in this context, and I'm only really
going to do it from time to time to keep the plug-in page on
www.vim.org alive.

Note also that I'm not going to both uploading to S3 anymore. I have
nowhere linking to it.

2 years agoMerge branch 'pull/369'
Greg Hurrell [Sat, 9 May 2020 16:36:32 +0000 (18:36 +0200)] 
Merge branch 'pull/369'

Closes: https://github.com/wincent/command-t/pull/369
* pull/369:
  docs: update AUTHORS and HISTORY sections
  refactor: tweak per `:h wildcard` definition
  feat: let *~ wildcard work.

2 years agodocs: update AUTHORS and HISTORY sections
Greg Hurrell [Sat, 9 May 2020 16:36:19 +0000 (18:36 +0200)] 
docs: update AUTHORS and HISTORY sections

2 years agorefactor: tweak per `:h wildcard` definition
Greg Hurrell [Sat, 9 May 2020 16:25:04 +0000 (18:25 +0200)] 
refactor: tweak per `:h wildcard` definition

Given that `:h wildcard` says this about "*" and friends:

        ?       matches one character
        *       matches anything, including nothing
        **      matches anything, including nothing, recurses into directories
        [abc]   match 'a', 'b' or 'c'

it means that a pattern like "*~" is supposed to match not only
"file~" but also "~" (and yes, this is a valid filename even though
you'd be crazy to make it).

So, tweaked the regex to match that by dropping the requirement for
any preceding match at all. I simplified the conditional too; now,
instead of treating the first position different from the following
positions, it just treats them all alike. In other words, the previous
version allowed a pattern like "*a.b"; now, it just allows "*a", "*ab"
etc.

2 years agofeat: let *~ wildcard work.
Steve Herrell [Fri, 1 May 2020 18:03:17 +0000 (14:03 -0400)] 
feat: let *~ wildcard work.

2 years agofix: avoid E116 when opening files with names containing single quotes
Greg Hurrell [Tue, 11 Feb 2020 11:24:29 +0000 (12:24 +0100)] 
fix: avoid E116 when opening files with names containing single quotes

Avoids:

    Error detected while processing function commandt#private#AcceptSelection:
    RuntimeError: Vim:E116: Invalid arguments for function fnameescape

2 years agochore: update bundle
Greg Hurrell [Sun, 1 Dec 2019 14:17:01 +0000 (15:17 +0100)] 
chore: update bundle

To stop GitHub yammering at us about Nokogiri:

    high severity

    Vulnerable versions: < 1.10.4

    Patched version: 1.10.4

    A command injection vulnerability in Nokogiri v1.10.3 and
    earlier allows commands to be executed in a subprocess via
    Ruby's Kernel.open method. Processes are vulnerable only if the
    undocumented method Nokogiri::CSS::Tokenizer#load_file is being
    called with unsafe user input as the filename. This vulnerability
    appears in code generated by the Rexical gem versions v1.0.6 and
    earlier. Rexical is used by Nokogiri to generate lexical scanner
    code for parsing CSS queries. The underlying vulnerability was
    addressed in Rexical v1.0.7 and Nokogiri upgraded to this version of
    Rexical in Nokogiri v1.10.4.

2 years agodoc: update HISTORY section
Greg Hurrell [Sun, 1 Dec 2019 14:09:50 +0000 (15:09 +0100)] 
doc: update HISTORY section

2 years agofix: allow opening selections which contain newlines (etc)
Greg Hurrell [Sun, 1 Dec 2019 14:04:45 +0000 (15:04 +0100)] 
fix: allow opening selections which contain newlines (etc)

Having files like this is crazy, of course (about the only sane
exception I can think of is if you're building a tool that has to deal
with crazy files, and you need to include test fixtures in it), but the
cost of supporting it is low so we may as well do it.

Closes: https://github.com/wincent/command-t/issues/365
2 years agofix: guard against error E315
Greg Hurrell [Tue, 13 Aug 2019 20:52:05 +0000 (22:52 +0200)] 
fix: guard against error E315

Hopefully mitigates this kind of error on accepting a selection:

    Error detected while processing function commandt#private#AcceptSelection:
    line    1:
    RuntimeError: Vim:E315: ml_get: invalid lnum: 19

With this relevant stack trace excerpt:

    /Library/Ruby/Gems/2.3.0/gems/neovim-0.8.0/lib/neovim/window.rb:27:in `height='
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/match_window.rb:356:in `block in restore_window_views'
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/match_window.rb:353:in `each'
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/match_window.rb:353:in `restore_window_views'
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/match_window.rb:205:in `unload'
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/match_window.rb:201:in `leave'
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/controller.rb:155:in `hide'
    /Users/glh/.config/nvim/pack/bundle/opt/command-t/ruby/command-t/lib/command-t/controller.rb:237:in `accept_selection'
    (eval):3:in `accept_selection'
    eval:1:in `<main>'

Sadly only "hopefully", because I don't have a reliable repro.

Possibly related:

    https://github.com/wincent/command-t/issues/266#issuecomment-316833804

2 years agoMerge branch 'pull/357'
Greg Hurrell [Fri, 2 Aug 2019 19:16:43 +0000 (21:16 +0200)] 
Merge branch 'pull/357'

Closes: https://github.com/wincent/command-t/pull/357
* pull/357:
  doc: update AUTHORS and HISTORY sections
  chore: update .mailmap
  fix: deleting a buffer closes the finder window
  Update CODE_OF_CONDUCT.md
  doc: Put placeholder for ongoing work in "master" in HISTORY section
  Update nokogiri dependency

2 years agodoc: update AUTHORS and HISTORY sections
Greg Hurrell [Fri, 2 Aug 2019 19:16:30 +0000 (21:16 +0200)] 
doc: update AUTHORS and HISTORY sections

2 years agochore: update .mailmap
Greg Hurrell [Fri, 2 Aug 2019 19:14:39 +0000 (21:14 +0200)] 
chore: update .mailmap

2 years agofix: deleting a buffer closes the finder window
etherandrius [Fri, 2 Aug 2019 11:10:45 +0000 (14:10 +0300)] 
fix: deleting a buffer closes the finder window

2 years agoMerge branch 'next'
Greg Hurrell [Fri, 28 Jun 2019 21:55:29 +0000 (23:55 +0200)] 
Merge branch 'next'

* next:
  docs: update AUTHORS section
  perf: improve dot dir filter in find_file_scanner
  doc: update a shortlink
  doc: update HISTORY section
  fix: resolve conflict with vim-cool plug-in
  doc: Add a note explaining a potential Dein version mismatch issue

2 years agoMerge branch 'pull/356'
Greg Hurrell [Fri, 28 Jun 2019 21:54:32 +0000 (23:54 +0200)] 
Merge branch 'pull/356'

Closes: https://github.com/wincent/command-t/pull/356
* pull/356:
  docs: update AUTHORS section
  perf: improve dot dir filter in find_file_scanner

2 years agodocs: update AUTHORS section
Greg Hurrell [Fri, 28 Jun 2019 21:50:21 +0000 (23:50 +0200)] 
docs: update AUTHORS section

2 years agoperf: improve dot dir filter in find_file_scanner
David Emett [Fri, 28 Jun 2019 18:16:22 +0000 (19:16 +0100)] 
perf: improve dot dir filter in find_file_scanner

Prune dot dirs, rather than walking through them and ignoring all the
files.

2 years agodoc: update a shortlink
Greg Hurrell [Sat, 1 Jun 2019 22:48:50 +0000 (00:48 +0200)] 
doc: update a shortlink

3 years agodoc: update HISTORY section
Greg Hurrell [Tue, 14 May 2019 20:42:44 +0000 (22:42 +0200)] 
doc: update HISTORY section

3 years agofix: resolve conflict with vim-cool plug-in
Greg Hurrell [Tue, 14 May 2019 20:40:48 +0000 (22:40 +0200)] 
fix: resolve conflict with vim-cool plug-in

vim-cool has an `OptionSet` autocmd that is running when Command-T sets
temporary options and ends up throwing an error.

Related: https://github.com/wincent/command-t/issues/354

3 years agoMerge branch 'pull/348'
Greg Hurrell [Sun, 12 May 2019 19:52:02 +0000 (21:52 +0200)] 
Merge branch 'pull/348'

Closes: https://github.com/wincent/command-t/pull/348
* pull/348:
  doc: Add a note explaining a potential Dein version mismatch issue

3 years agodoc: Add a note explaining a potential Dein version mismatch issue
Jakob Pfender [Sun, 17 Feb 2019 23:00:53 +0000 (12:00 +1300)] 
doc: Add a note explaining a potential Dein version mismatch issue

Signed-off-by: Greg Hurrell <greg@hurrell.net>
3 years agoMerge branch 'next'
Greg Hurrell [Sun, 12 May 2019 19:42:39 +0000 (21:42 +0200)] 
Merge branch 'next'

* next:
  chore: fix whitespace
  chore: update nokogiri dependency
  doc: update AUTHORS section
  chore: sort .gitignore
  fix: change the load path style from windows to unix
  Add media to .gitignore
  Update CODE_OF_CONDUCT.md
  doc: update HISTORY section
  Avoid potential nested :redir when possible by preferring execute()
  doc: update HISTORY section
  Catch E434 errors trying to jump to help targets
  Make methods that may be exercised in statuslines available in stub
  Add missing space in commandt#CheckBuffer()
  Update nokogiri dependency
  doc: Prepare HISTORY section for ongoing work

3 years agochore: fix whitespace
Greg Hurrell [Sun, 12 May 2019 19:40:03 +0000 (21:40 +0200)] 
chore: fix whitespace

3 years agochore: update nokogiri dependency
Greg Hurrell [Sun, 12 May 2019 19:34:37 +0000 (21:34 +0200)] 
chore: update nokogiri dependency

Because otherwise GitHub will nag me about CVE-2018-14404.

3 years agoMerge branch 'pull/353'
Greg Hurrell [Sun, 12 May 2019 19:26:47 +0000 (21:26 +0200)] 
Merge branch 'pull/353'

Closes: https://github.com/wincent/command-t/pull/353
* pull/353:
  doc: update AUTHORS section
  chore: sort .gitignore
  fix: change the load path style from windows to unix

3 years agodoc: update AUTHORS section
Greg Hurrell [Sun, 12 May 2019 19:26:17 +0000 (21:26 +0200)] 
doc: update AUTHORS section

3 years agochore: sort .gitignore
Greg Hurrell [Sun, 12 May 2019 19:21:14 +0000 (21:21 +0200)] 
chore: sort .gitignore

3 years agofix: change the load path style from windows to unix
xiaodezhang [Fri, 12 Apr 2019 01:45:19 +0000 (09:45 +0800)] 
fix: change the load path style from windows to unix

And add vim swp file to the git ignore file.

Signed-off-by: Greg Hurrell <greg@hurrell.net>
3 years agoAdd media to .gitignore
Greg Hurrell [Sun, 31 Mar 2019 20:57:45 +0000 (22:57 +0200)] 
Add media to .gitignore

So that I can have a local checkout of the media branch via `git
worktree add media media`.

3 years agoUpdate CODE_OF_CONDUCT.md
Greg Hurrell [Sun, 31 Mar 2019 20:57:09 +0000 (22:57 +0200)] 
Update CODE_OF_CONDUCT.md

3 years agoUpdate CODE_OF_CONDUCT.md
Greg Hurrell [Sun, 31 Mar 2019 20:56:21 +0000 (22:56 +0200)] 
Update CODE_OF_CONDUCT.md

3 years agodoc: update HISTORY section
Greg Hurrell [Mon, 18 Feb 2019 23:30:40 +0000 (00:30 +0100)] 
doc: update HISTORY section

3 years agoAvoid potential nested :redir when possible by preferring execute()
Greg Hurrell [Mon, 18 Feb 2019 23:27:37 +0000 (00:27 +0100)] 
Avoid potential nested :redir when possible by preferring execute()

3 years agodoc: update HISTORY section
Greg Hurrell [Wed, 13 Feb 2019 21:20:56 +0000 (22:20 +0100)] 
doc: update HISTORY section

3 years agoCatch E434 errors trying to jump to help targets
Greg Hurrell [Wed, 13 Feb 2019 21:14:49 +0000 (22:14 +0100)] 
Catch E434 errors trying to jump to help targets

This should be a pretty rare event, but as the comments indicate, it is
currently happening in at least one plug-in that I use.

3 years agoMake methods that may be exercised in statuslines available in stub
Greg Hurrell [Thu, 6 Dec 2018 21:30:27 +0000 (22:30 +0100)] 
Make methods that may be exercised in statuslines available in stub

3 years agoAdd missing space in commandt#CheckBuffer()
Greg Hurrell [Thu, 6 Dec 2018 21:30:12 +0000 (22:30 +0100)] 
Add missing space in commandt#CheckBuffer()

3 years agodoc: Put placeholder for ongoing work in "master" in HISTORY section
Greg Hurrell [Wed, 19 Sep 2018 21:35:58 +0000 (23:35 +0200)] 
doc: Put placeholder for ongoing work in "master" in HISTORY section

3 years agoUpdate nokogiri dependency
Greg Hurrell [Wed, 19 Sep 2018 21:33:01 +0000 (23:33 +0200)] 
Update nokogiri dependency

According to GitHub, the old one had security vulnerabilities:

- CVE-2017-9050 Critical severity
- CVE-2017-18258 Moderate severity
- CVE-2017-5029 Low severity
- CVE-2015-5312 High severity
- CVE-2016-4658 High severity
- CVE-2015-8806 Moderate severity
- CVE-2015-7499 Moderate severity

Not super concerned here as nokogiri is a dev dependency only so there
is no user-facing impact here, but I want to stop GitHub yammering at
me.

3 years agoUpdate nokogiri dependency
Greg Hurrell [Wed, 19 Sep 2018 21:33:01 +0000 (23:33 +0200)] 
Update nokogiri dependency

According to GitHub, the old one had security vulnerabilities:

- CVE-2017-9050 Critical severity
- CVE-2017-18258 Moderate severity
- CVE-2017-5029 Low severity
- CVE-2015-5312 High severity
- CVE-2016-4658 High severity
- CVE-2015-8806 Moderate severity
- CVE-2015-7499 Moderate severity

Not super concerned here as nokogiri is a dev dependency only so there
is no user-facing impact here, but I want to stop GitHub yammering at
me.

3 years agodoc: Prepare HISTORY section for ongoing work
Greg Hurrell [Wed, 19 Sep 2018 21:32:41 +0000 (23:32 +0200)] 
doc: Prepare HISTORY section for ongoing work

3 years agodoc: prep for 5.0.3 release 5.0.3
Greg Hurrell [Wed, 19 Sep 2018 20:56:11 +0000 (22:56 +0200)] 
doc: prep for 5.0.3 release

3 years agoGuard against wiped-out match listing buffer in Neovim
Greg Hurrell [Wed, 19 Sep 2018 20:50:07 +0000 (22:50 +0200)] 
Guard against wiped-out match listing buffer in Neovim

If somebody deletes the Command-T match listing buffer on Neovim (eg.
with `:bwipeout`), Command-T will blow up on the next invocation because
Neovim doesn't define `Vim::DeletedBufferError`.

Closes: https://github.com/wincent/command-t/issues/342
Thanks to Javier Parra for the bug report with a minimal repro recipe
and diagnosis of the problem.

4 years agodoc: update HISTORY section for "next" branch
Greg Hurrell [Thu, 14 Dec 2017 00:32:49 +0000 (16:32 -0800)] 
doc: update HISTORY section for "next" branch

4 years agoDon't re-evaulate jumps for every keypress
Greg Hurrell [Thu, 14 Dec 2017 00:17:59 +0000 (16:17 -0800)] 
Don't re-evaulate jumps for every keypress

Just like we did for BufferScanner and friends. It's fast, but may as
well not do stupid work.

4 years agoDon't bother caching CommandScanner results
Greg Hurrell [Thu, 14 Dec 2017 00:09:51 +0000 (16:09 -0800)] 
Don't bother caching CommandScanner results

Scanning the commands is fast enough[*] to do it on every invocation, so
let's do it on every invocation. That way, if something gets lazy-loaded
and we wind up with a new command, we'll pick it up.

[*]: I don't have any hard numbers to back that up, but my subjective
impression is that it takes a basically imperceptible amount of time.

4 years agoReplace O(n^2) MRU pattern with O(n)
Greg Hurrell [Thu, 14 Dec 2017 00:02:44 +0000 (16:02 -0800)] 
Replace O(n^2) MRU pattern with O(n)

As noted in the previous commit, this is not a big deal because "n" is
small, but for the sake of hygiene we may as well implement the easy
fix.

4 years agoFix CommandTMRU degenerate performance under Neovim
Greg Hurrell [Wed, 13 Dec 2017 23:55:15 +0000 (15:55 -0800)] 
Fix CommandTMRU degenerate performance under Neovim

Same as we did with CommandTBuffer, but a deeper refactor. Switches the
MRU module to track buffer numbers instead of full-blown buffer objects.
If nothing else, this means we'll not be as likely to accumulate garbage
over time.

The perf is fine now, despite the O(n^2) logic in the unused buffer loop
(the `#used?` method scans the entire stack, and we call it once for
every buffer in the list) because n is usually small (even 200 * 200
comparisons here is plenty fast). I'll still replace that with something
O(n) though as a follow-up, because otherwise it offends my
sensibilities a bit.

4 years agoDon't recalculate buffers on every key press for MRUBufferFinder
Greg Hurrell [Wed, 13 Dec 2017 23:27:52 +0000 (15:27 -0800)] 
Don't recalculate buffers on every key press for MRUBufferFinder

Same as the fix I just did for BufferFinder. (Note this also suffers
from the slowness on Neovim, so going to fix that in the same way I did
for BufferFinder.)

4 years agoDon't rescan buffers for every key press
Greg Hurrell [Wed, 13 Dec 2017 23:21:33 +0000 (15:21 -0800)] 
Don't rescan buffers for every key press

As previously written, we would call `#paths` on every key press,
resulting in a full scan.

Instead, behave like the history scanner does: create a new one for each
interaction, and have that instance memoize the results for the duration
of that interaction.

4 years agoWork around pathologically slow buffer scanning in Neovim
Greg Hurrell [Wed, 13 Dec 2017 23:09:08 +0000 (15:09 -0800)] 
Work around pathologically slow buffer scanning in Neovim

In Neovim, unlisted buffers are returned to the Ruby layer. If you run
Ferret's :Ack, for example, you might find yourself with a large number
of those (as `:h unlisted-buffer` says, Vim uses these to track things
like file names). As such, it is too easy to wind up with a *huge*
number of unlisted buffers, and the scanner takes forever.

This is exacerbated by the scanner being called on every keypress.

Fix the slow processing by avoiding use of `VIM::Buffer` entirely, and
instead call out to native Vim commands.

This alone makes it usable again. In a follow-up commit I'll do the
"right" thing and make it not call the scanner repeatedly during a
single invocation.

4 years agoMerge branch 'pull/315'
Greg Hurrell [Fri, 17 Nov 2017 03:46:11 +0000 (19:46 -0800)] 
Merge branch 'pull/315'

Closes: https://github.com/wincent/command-t/pull/315
* pull/315:
  doc: update AUTHORS and HISTORY
  Fix GotoOrOpen command

4 years agodoc: update AUTHORS and HISTORY
Greg Hurrell [Fri, 17 Nov 2017 03:45:00 +0000 (19:45 -0800)] 
doc: update AUTHORS and HISTORY

4 years agoFix GotoOrOpen command
Alexey Terekhov [Sat, 11 Nov 2017 15:46:52 +0000 (18:46 +0300)] 
Fix GotoOrOpen command

4 years agoFix unlisted buffers showing up in :CommandTBuffer in Neovim
Greg Hurrell [Fri, 29 Sep 2017 17:50:05 +0000 (10:50 -0700)] 
Fix unlisted buffers showing up in :CommandTBuffer in Neovim

4 years agodoc: create new HISTORY section for master development
Greg Hurrell [Thu, 7 Sep 2017 18:50:34 +0000 (11:50 -0700)] 
doc: create new HISTORY section for master development

4 years agoPrep for v5.0.2 release 5.0.2
Greg Hurrell [Thu, 7 Sep 2017 18:45:26 +0000 (11:45 -0700)] 
Prep for v5.0.2 release

4 years agoAvoid unwanted escaping in :CommandTCommand and :CommandTTag
Greg Hurrell [Thu, 7 Sep 2017 18:40:50 +0000 (11:40 -0700)] 
Avoid unwanted escaping in :CommandTCommand and :CommandTTag

Also adjusting `:CommandTHistory` to use the same approach, for
consistency.

4 years agoMake opening targets like "#" work in :CommandTHelp
Greg Hurrell [Thu, 7 Sep 2017 18:21:30 +0000 (11:21 -0700)] 
Make opening targets like "#" work in :CommandTHelp

Closes: https://github.com/wincent/command-t/issues/307
I'll also look at the other finders and see if a similar approach makes
sense for any of them.

4 years agoFix regression trying to switch to previously opened file in other tab
Greg Hurrell [Wed, 6 Sep 2017 20:46:57 +0000 (13:46 -0700)] 
Fix regression trying to switch to previously opened file in other tab

This is a regression introduced in 85949ce7.

That one attempted to fix #298 by applying a similar fix to the one used
in #295. However, it only worked by luck: `bufexists()` doesn't support
patterns or use of "$"/"^" to anchor the match like `bufwinnr()` does.
This meant that adding those anchors made it always false.

That fixed the unwanted splits in #298, but it meant that you couldn't
go back to an existing file in another tab.

The fix is pretty straightforward: switch from `bufexists()` to
`bufname()`, because the latter does support anchoring. As far as I can
tell, this fixes #306 without breaking the scenario detailed in #298.
The one gotcha here is that we can't rely on the truthiness of the
non-empty string returned by `bufname()` here, because crazy old
Vimscript coerces also strings to `0`; we therefore have to use an
explicit check against `''`.

Closes: https://github.com/wincent/command-t/issues/306
4 years agoMerge branch 'pull/304'
Greg Hurrell [Wed, 30 Aug 2017 04:04:50 +0000 (21:04 -0700)] 
Merge branch 'pull/304'

Closes: https://github.com/wincent/command-t/pull/304
* pull/304:
  doc: update AUTHORS and HISTORY sections
  Remove NUM2LONG conversions of object ids

4 years agodoc: update AUTHORS and HISTORY sections
Greg Hurrell [Wed, 30 Aug 2017 04:04:36 +0000 (21:04 -0700)] 
doc: update AUTHORS and HISTORY sections

4 years agoRemove NUM2LONG conversions of object ids
Adrian Keet [Tue, 29 Aug 2017 05:51:00 +0000 (22:51 -0700)] 
Remove NUM2LONG conversions of object ids

Instead of converting object_ids to LONG and testing for equality,
compare them directly with rb_equal. This avoids "bignum too big to
convert into `long'" errors on Windows.

4 years agoSoft-wrap CONTRIBUTING.md
Greg Hurrell [Fri, 18 Aug 2017 14:47:16 +0000 (07:47 -0700)] 
Soft-wrap CONTRIBUTING.md

4 years agodoc: style version numbers as subheadings in the changelog
Greg Hurrell [Fri, 18 Aug 2017 14:47:16 +0000 (07:47 -0700)] 
doc: style version numbers as subheadings in the changelog

4 years agodoc: ready the changelog for subsequent updates
Greg Hurrell [Fri, 18 Aug 2017 14:47:16 +0000 (07:47 -0700)] 
doc: ready the changelog for subsequent updates

4 years agodoc: Add another link to related projects
Greg Hurrell [Fri, 18 Aug 2017 14:47:16 +0000 (07:47 -0700)] 
doc: Add another link to related projects

4 years agoAdd CONTRIBUTING.md
Greg Hurrell [Fri, 18 Aug 2017 14:47:16 +0000 (07:47 -0700)] 
Add CONTRIBUTING.md

Again, suggested by GitHub. I am too lazy to flesh this one out fully at
this point (there are some truly epic, 30-minute-read examples out
there), but not going to bother with it for now.

4 years agoRemove hard-wrapping in code of conduct
Greg Hurrell [Fri, 18 Aug 2017 14:41:56 +0000 (07:41 -0700)] 
Remove hard-wrapping in code of conduct

Because that's the way I do Markdown.

4 years agoSet email address in code of conduct
Greg Hurrell [Fri, 18 Aug 2017 14:41:56 +0000 (07:41 -0700)] 
Set email address in code of conduct

Don't really have a "team" email address, so this will have to do.

4 years agoAdd code of conduct
Greg Hurrell [Fri, 18 Aug 2017 14:41:56 +0000 (07:41 -0700)] 
Add code of conduct

Probably overkill for a tiny "community" like this one, but GitHub
suggested it and I like the idea.

This is the code of conduct from:

https://contributor-covenant.org/version/1/4/code_of_conduct.md

4 years agoPrep for 5.0.1 release 5.0.1
Greg Hurrell [Fri, 18 Aug 2017 14:36:52 +0000 (07:36 -0700)] 
Prep for 5.0.1 release

4 years agoMake Ctrl-W match zsh-ish behavior
Greg Hurrell [Fri, 18 Aug 2017 14:36:52 +0000 (07:36 -0700)] 
Make Ctrl-W match zsh-ish behavior

As pointed out in https://github.com/wincent/command-t/issues/301 Ctrl-W
would not delete past punctuation characters.

I did some testing in zsh to see what that does and updated the regex to
match:

   foo bar.baz        (deletes "baz" then "bar.")
   foo bar....baz     (deletes "baz" then "bar....")
      indented        (deletes "indented" but won't delete leading ws)

Note that unlike the old pattern, it is possible for this one to not
match, so I added an `if` guard.

Should probably have tests for this.

Closes: https://github.com/wincent/command-t/issues/301
4 years agoFix unwanted split opening behavior
Greg Hurrell [Wed, 12 Jul 2017 01:35:24 +0000 (18:35 -0700)] 
Fix unwanted split opening behavior

Similar to the fix we applied in 595976eb70ba3a2f7a2932eeb4 to fix
https://github.com/wincent/command-t/issues/295 looks like we have to
deal with this edge case too.

Closes https://github.com/wincent/command-t/issues/298

4 years agoPrefer longer, more explicit command names
Greg Hurrell [Fri, 23 Jun 2017 14:38:15 +0000 (07:38 -0700)] 
Prefer longer, more explicit command names

4 years agoFix problem opening identically named buffers with `:sbuffer`
Greg Hurrell [Fri, 23 Jun 2017 14:29:51 +0000 (07:29 -0700)] 
Fix problem opening identically named buffers with `:sbuffer`

Closes: https://github.com/wincent/command-t/issues/295
Just say we open "win32/capturer.rs" and then try to open "capturer.rs".

For the first file, we'll fall through to the `else` branch in
`commandt#GotoOrOpen` and open it with `:edit`. For the second file, our
`buwinnr()` check will report that the buffer is already open, so we'll
try to open it with `:sbuffer` which causes us to go back to the
previous file instead of opening the new one that we wanted.

The fix here is to do a stricter match in `bufwinnr()`. In this way,
when we try to open the second file ("capturer.rs") our
check(`bufwinnr("^capturer.rs$")`) will fail, and we'll open the new
file correctly with `:edit`.

I've tested this manually with a bunch of permutations of splits, tabs,
and file orderings, and I don't believe this breaks any of the existing
functionality.

4 years agodoc: Fix a couple of bad cross-links
Greg Hurrell [Sun, 18 Jun 2017 04:19:35 +0000 (21:19 -0700)] 
doc: Fix a couple of bad cross-links

Closes: https://github.com/wincent/command-t/issues/292
4 years agoMerge branch 'pull/291'
Greg Hurrell [Tue, 13 Jun 2017 03:28:05 +0000 (20:28 -0700)] 
Merge branch 'pull/291'

Closes: https://github.com/wincent/command-t/pull/291
* pull/291:
  doc: Add Jakob Pfender to AUTHORS section
  fix emphasis in doc file that created a tag

4 years agodoc: Add Jakob Pfender to AUTHORS section
Greg Hurrell [Tue, 13 Jun 2017 03:27:26 +0000 (20:27 -0700)] 
doc: Add Jakob Pfender to AUTHORS section