https://github.com/vim/vim/pull/9974
(4 files)
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Merging #9974 (146c989) into master (47c532e) will decrease coverage by
1.05%.
The diff coverage is72.72%.
@@ Coverage Diff @@ ## master #9974 +/- ## ========================================== - Coverage 81.90% 80.85% -1.06% ========================================== Files 167 152 -15 Lines 187295 174465 -12830 Branches 42207 39552 -2655 ========================================== - Hits 153405 141062 -12343 + Misses 21540 20751 -789 - Partials 12350 12652 +302
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | 82.31% <72.72%> (+<0.01%) |
⬆️ |
| huge-gcc-none | ? |
|
| huge-gcc-testgui | ? |
|
| huge-gcc-unittests | 2.01% <0.00%> (-0.01%) |
⬇️ |
| linux | 80.85% <72.72%> (-3.04%) |
⬇️ |
| mingw-x64-HUGE | ? |
|
| mingw-x64-HUGE-gui | ? |
|
| windows | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/ex_docmd.c | 88.18% <66.66%> (-3.42%) |
⬇️ |
| src/scriptfile.c | 82.87% <73.68%> (-0.61%) |
⬇️ |
| src/libvterm/src/rect.h | 0.00% <0.00%> (-96.78%) |
⬇️ |
| src/libvterm/src/state.c | 34.80% <0.00%> (-54.77%) |
⬇️ |
| src/libvterm/src/keyboard.c | 40.00% <0.00%> (-47.63%) |
⬇️ |
| src/libvterm/include/vterm.h | 0.00% <0.00%> (-44.45%) |
⬇️ |
| src/libvterm/src/parser.c | 55.41% <0.00%> (-40.49%) |
⬇️ |
| src/libvterm/src/pen.c | 44.37% <0.00%> (-39.90%) |
⬇️ |
| src/libvterm/src/encoding.c | 37.37% <0.00%> (-36.16%) |
⬇️ |
| src/libvterm/src/vterm.c | 39.17% <0.00%> (-27.21%) |
⬇️ |
| ... and 148 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update 47c532e...146c989. Read the comment docs.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Can it source the following:
vim9script
def Hello()
var myList = ['multi',
'lined',
'list'
]
echo myList[0]
enddef
nnoremap <F5> <ScriptCmd>Hello()<CR>
:4,7source:11source -- would proper script context be used here?—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
We can keep using sourcing_a_script(), hide the details of how that is decided.
I don't think we should try to be clever and detect the kind of script. If someone sources some sequence of buffer lines we can't really know whether they are legacy or Vim9 script. They could even be some lines in a help file. We can require using "vim9cmd source". Unless "vim9script" is the first command in the range of lines.
We also need to define what happens when sourcing from the same buffer again. I suppose this would work like "vim9script noclear". That way you could, for example, source a function again after modifying it.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
We can keep using sourcing_a_script(), hide the details of how that is decided.
I don't think we should try to be clever and detect the kind of script. If someone sources some sequence of buffer lines we can't really know whether they are legacy or Vim9 script. They could even be some lines in a help file. We can require using "vim9cmd source". Unless "vim9script" is the first command in the range of lines.
We also need to define what happens when sourcing from the same buffer again. I suppose this would work like "vim9script noclear". That way you could, for example, source a function again after modifying it.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
There is a remark in the help about using the same SID when sourcing multiple times.
It would be good to say a few things about what happens when redefining a function. I suppose that works.
But other items from the script are still there, thus it would work like "vim9script noclear".
As is explained at "vim9-reload".
When sourcing just a few lines, e.g. from a help buffer, "vim9cmd source" should work.
Please add a test for that.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
To source a Vim9 script from a buffer, it must start with "vim9script" as the first line. For a legacy script, you can source any range of lines.
I have this operator to run both vimscript and vim9script ranges:
# source vimscript (operator)
def SourceVim(...args: list<any>): any
if len(args) == 0
&opfunc = matchstr(expand('<stack>'), '[^. ]*\ze[')
return 'g@'
endif
if getline(1) =~ '^vim9script$'
vim9cmd :'[,']source
else
:'[,']source
endif
return ''
enddef
nnoremap <silent> <expr> <space>v SourceVim()
xnoremap <silent> <expr> <space>v SourceVim()
nnoremap <silent> <expr> <space>vv SourceVim() .. '_'
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()