[vim/vim] Get rid off some legacy vim syntax, added deprecation warnings and test. (PR #15304)

24 views
Skip to first unread message

ubaldot

unread,
Jul 19, 2024, 6:39:16 AM (3 days ago) Jul 19
to vim/vim, Subscribed

Q1: Are legacy v:true/v:false equivalent to Vim9 true/false?
Q2: Would that be possible to rewrite the termdebug tests in Vim9?


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/15304

Commit Summary

  • 6f1144b Get rid off some legacy vim syntax, added deprecation warnings and

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304@github.com>

Christian Brabandt

unread,
Jul 19, 2024, 9:56:58 AM (3 days ago) Jul 19
to vim/vim, Subscribed

@chrisbra commented on this pull request.


In runtime/doc/terminal.txt:

> @@ -1530,9 +1530,9 @@ in a buffer with 'buftype' set to "prompt".  This works slightly differently:
 
 						*termdebug_use_prompt*
 Prompt mode can be used even when the |+terminal| feature is present with: >
-	let g:termdebug_config['use_prompt'] = 1
+	let g:termdebug_config['use_prompt'] = true

This uses legacy vim script syntax, so should be v:true


In runtime/doc/terminal.txt:

>  If there is no g:termdebug_config you can use: >
-	let g:termdebug_use_prompt = 1
+	let g:termdebug_use_prompt = true

same here


In runtime/doc/terminal.txt:

> @@ -1544,26 +1544,26 @@ are reset to their original values once the termdebug session concludes.
 					*termdebug_map_K* *termdebug-mappings*
 The K key is normally mapped to |:Evaluate| unless a buffer local (|:map-local|)
 mapping to K already exists.  If you do not want this use: >
-	let g:termdebug_config['map_K'] = 0
+	let g:termdebug_config['map_K'] = false

and here


In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:

> @@ -63,7 +63,7 @@ command -nargs=+ -complete=file -bang TermdebugCommand StartDebugCommand(<bang>0
 
 enum Way
   Prompt,
-  Terminal
+    Terminal

white space error


In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:

>    })
   if job_status(gdbjob) != "run"
     Echoerr('Failed to start gdb')
     exe $'bwipe! {promptbufnr}'
     return
   endif
   exe $'au BufUnload <buffer={promptbufnr}> ++once ' ..
-       'call job_stop(gdbjob, ''kill'')'
+    'job_stop(gdbjob, ''kill'')'

I am not sure this is correct. Are you sure the exec'ed string is evaluated in vim9 script semantics?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/review/2188295593@github.com>

Christian Brabandt

unread,
Jul 19, 2024, 9:58:34 AM (3 days ago) Jul 19
to vim/vim, Subscribed

Thanks. In general, it would be beneficial to have separate commits for

  • cleaning up white space
  • adding new functions (e.g. for the deprecation warning)
  • changing arguments to true/false

That makes reviewing a bit easier.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/c2239244276@github.com>

ubaldot

unread,
Jul 19, 2024, 7:27:01 PM (3 days ago) Jul 19
to vim/vim, Subscribed

You are right, sorry!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/c2240635113@github.com>

ubaldot

unread,
Jul 20, 2024, 2:57:01 AM (2 days ago) Jul 20
to vim/vim, Push

@ubaldot pushed 1 commit.

  • 9541da0 true -> v:true in docs, fixed whitespace error.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/before/6f1144bd069f51cc22948d172a28d8221eea76e8/after/9541da0913f8b8cb39b87fdc59467faa8e2d45e5@github.com>

ubaldot

unread,
Jul 20, 2024, 2:57:21 AM (2 days ago) Jul 20
to vim/vim, Subscribed

@ubaldot commented on this pull request.


In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:

>    })
   if job_status(gdbjob) != "run"
     Echoerr('Failed to start gdb')
     exe $'bwipe! {promptbufnr}'
     return
   endif
   exe $'au BufUnload <buffer={promptbufnr}> ++once ' ..
-       'call job_stop(gdbjob, ''kill'')'
+    'job_stop(gdbjob, ''kill'')'

Not really... I replaced it back.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/review/2189776974@github.com>

Christian Brabandt

unread,
Jul 20, 2024, 5:59:11 AM (2 days ago) Jul 20
to vim/vim, Subscribed

thanks!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/c2241068312@github.com>

Christian Brabandt

unread,
Jul 20, 2024, 6:07:13 AM (2 days ago) Jul 20
to vim/vim, Subscribed

Closed #15304 via a90b0b4.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15304/issue_event/13589102663@github.com>

Reply all
Reply to author
Forward
0 new messages