Skip to content

Commit a6a2a39

Browse files
committed
refactor!: make the Lua core the default
1 parent 355f27e commit a6a2a39

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

doc/command-t.txt

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,17 @@ ugly. Interestingly, from the perspective of Command-T, interfacing with a
133133
C library from Lua is relatively straightforward due to the excellent FFI
134134
support.
135135

136-
From version 6.0, as the result of a complete rewrite, the core of Command-T
137-
is now written in Lua and C, and it only supports Neovim. The C library is now
138-
pure POSIX-compliant C, free from any references to the Ruby virtual machine.
139-
This, combined with the low overhead of calling into C from Lua via the FFI
140-
means that the performance critical parts of the code are even faster than
141-
before, up to twice as fast according to the benchmarks. In addition, by
142-
targeting newer APIs and writing the UI code in Lua, that portion of the core
143-
is also significantly more responsive and robust. Various UI quirks have been
144-
eliminated in this way, including the aforementioned problems with pasting
145-
queries (Command-T uses a real buffer for input now, which means that all
146-
standard Vim editing commands can be used inside the prompt area).
136+
From version 6.0, as the result of a complete rewrite, Command-T now includes
137+
a new core written in Lua and C, and the new core only supports Neovim. The
138+
new C library is pure POSIX-compliant C, free from any references to the Ruby
139+
virtual machine. This, combined with the low overhead of calling into C from
140+
Lua via the FFI means that the performance critical parts of the code are
141+
even faster than before, up to twice as fast according to the benchmarks. In
142+
addition, by targeting newer APIs and writing the UI code in Lua, that portion
143+
of the core is also significantly more responsive and robust. Various UI
144+
quirks have been eliminated in this way, including the aforementioned problems
145+
with pasting queries (Command-T uses a real buffer for input now, which means
146+
that all standard Vim editing commands can be used inside the prompt area).
147147

148148
There is a cost, however. Most notably, the rewrite is not yet a
149149
feature-complete copy of the original Ruby-powered version, and filling in
@@ -191,7 +191,7 @@ Call:
191191
>
192192
require('wincent.commandt').setup()
193193
<
194-
early on in your |vimrc|, before the Ruby plug-in code has had a chance to
194+
early on in your |vimrc|, before the Ruby plug-in code has had a chance to
195195
execute. Alternatively, if you wish to defer calling |commandt.setup()| until
196196
later on in the |startup| process, you can instead define early on:
197197
>
@@ -240,17 +240,18 @@ implementation via one of the above means. You can either follow this prompt,
240240
or ignore it, but it will appear every time that you open Neovim until you
241241
make a decision.
242242

243-
If you don't opt-in explicitly, Command-T version 6.0 will behave as though
244-
you had chosen Ruby. Starting with version 7.0, it will behave as though you
245-
had chosen Lua.
243+
In the absence of an explicit opt-in, Command-T version 6.0 behaved as though
244+
you had chosen Ruby. Starting with version 7.0, it behaves as though you had
245+
chosen Lua. In version 8.0, the Ruby implementation will be entirely removed.
246246

247-
If you are running Vim instead of Neovim, Command-T will behave as though you
248-
had chosen Ruby.
247+
In the meantime, if you are running Vim instead of Neovim, Command-T will
248+
behave as though you had chosen Ruby.
249249

250250
If you wish to avoid the entire business of upgrading, you can set up your
251251
plug-in manager to track the Command-T `5-x-release` branch instead of `main`.
252252
That branch only contains the Ruby code, and none of the Lua changes that
253-
started with the 6.0 release.
253+
started with the 6.0 release. `6-x-release` and `7-x-release` branches will be
254+
made available as well for people who wish to track those instead.
254255

255256

256257
TROUBLE-SHOOTING *command-t-trouble-shooting*
@@ -1044,9 +1045,11 @@ POSSIBILITY OF SUCH DAMAGE.
10441045

10451046
HISTORY *command-t-history*
10461047

1047-
main (not yet released) ~
1048+
7.0 (23 June 2025) ~
10481049

1049-
- ...
1050+
- Unless the user has specified a preference for the Ruby version of Command-T
1051+
by setting `g:CommandTPreferredImplementation` to `'ruby'`, the Lua version
1052+
will be used by default.
10501053

10511054
6.2 (23 June 2025) ~
10521055

plugin/command-t.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ let s:has_preference=s:prefers_ruby || s:prefers_lua
1212

1313
if has('nvim') && !s:has_preference
1414
let s:lua_suppression=[
15-
\ ['To select Ruby (for the v6.0 series, the default):', "vim.g.CommandTPreferredImplementation = 'ruby'"],
16-
\ ['To select Lua (from v7.0, will be the new default):', "require('wincent.commandt').setup()"]
15+
\ ['To select Ruby:', "vim.g.CommandTPreferredImplementation = 'ruby'"],
16+
\ ['To select Lua (the default):', "require('wincent.commandt').setup()"]
1717
\ ]
1818
let s:vimscript_suppression=[
19-
\ ['To select Ruby (for the v6.0 series, the default):', "let g:CommandTPreferredImplementation='ruby'"],
20-
\ ['To select Lua (from v7.0, will be the new default):', "let g:CommandTPreferredImplementation='lua'"]
19+
\ ['To select Ruby:', "let g:CommandTPreferredImplementation='ruby'"],
20+
\ ['To select Lua (the default):', "let g:CommandTPreferredImplementation='lua'"]
2121
\ ]
2222
let s:suppression=exists('$MYVIMRC') && match($MYVIMRC, '\c\.lua') > 0
2323
\ ? s:lua_suppression
@@ -26,9 +26,9 @@ if has('nvim') && !s:has_preference
2626
echo 'Notice'
2727
echo '------'
2828
echo "\n"
29-
echo 'Starting with Command-T version 6.0, Command-T has been rewritten in'
30-
echo 'Lua (rather than Ruby), and supports only Neovim (rather than Vim and'
31-
echo 'Neovim). The new version is faster and more robust.'
29+
echo 'Starting with Command-T version 6.0, Command-T ships with a new core'
30+
echo 'written in Lua (rather than Ruby). The new core supports only Neovim'
31+
echo '(rather than Vim and Neovim), and is faster and more robust.'
3232
echo "\n"
3333
echo 'See `:help command-t-upgrading` for information on how to choose'
3434
echo 'between the Lua and the Ruby implementations.'
@@ -41,7 +41,7 @@ if has('nvim') && !s:has_preference
4141
echo "\n"
4242
endfor
4343
echohl none
44-
let s:prefers_ruby=1
44+
let s:prefers_lua=1
4545
endif
4646

4747
if empty(&switchbuf)

0 commit comments

Comments
 (0)