// and did same like 'saved_mousemodel' chk
https://github.com/vim/vim/pull/15013
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@errael commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> endif - if exists('plus_map_saved') - if !empty(plus_map_saved) && !plus_map_saved.buffer + if plus_map_saved isnot null_dict⬇️ Suggested change
- if plus_map_saved isnot null_dict + if plus_map_saved != null
For reference
vim9script
var d1: dict<any> = null_dict
var d2: dict<any> = {}
echo 'is d1 null?' d1 == null
echo 'is d2 null?' d2 == null
outputs
is d1 null? true
is d2 null? false
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> @@ -1232,32 +1232,38 @@ def DeleteCommands() delcommand Var delcommand Winbar - if exists('k_map_saved') - if !empty(k_map_saved) && !k_map_saved.buffer + if k_map_saved isnot null_dict⬇️ Suggested change
- if k_map_saved isnot null_dict + if k_map_saved != null
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> endif - if exists('minus_map_saved') - if !empty(minus_map_saved) && !minus_map_saved.buffer + if minus_map_saved isnot null_dict⬇️ Suggested change
- if minus_map_saved isnot null_dict + if minus_map_saved != null
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> endif - if exists('plus_map_saved') - if !empty(plus_map_saved) && !plus_map_saved.buffer + if plus_map_saved isnot null_dict
if you recalled some months ago what we argued in such null/null_obj topic which chris applied your PR,
i am confused now truly null or null_obj which was your taste? 😅
anyway, {} isnot null_dict
also is true, specially it is just keeping it same operation as saved_mousemodel
did,
so i think ok.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@errael commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> endif - if exists('plus_map_saved') - if !empty(plus_map_saved) && !plus_map_saved.buffer + if plus_map_saved isnot null_dict
strings are the weirdest of them all when it comes to null handling. With strings you must use isnot null_string
, as it says at :help null-anomalies
Unlike the other containers, an uninitialized string is equal to null.
I left out some important cases from the example.
echo 'is d1 null_dict?' d1 == null_dict echo 'is d2 nul_dictl?' d2 == null_dict
Both return true
.
!= null
is easier to understand than isnot null_dict
(at least for me). It also looks like what you'd expect to see in most any other language; to me, that makes it easier to maintain.
As you say, what's currently there works; just not as maintainable (but that's only my opinion)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian Thanks! Could you please add some tests?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
why the silent!
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap + mapset(plus_map_saved) elseif empty(plus_map_saved) - nunmap + + silent! nunmap +
why the silent!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
there maybe buf local mapping at source, so e.g gdb had no 'K' mapping actually.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
there maybe buf local mapping at source window, then e.g gdb window had no 'K' mapping actually.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> @@ -1232,32 +1232,38 @@ def DeleteCommands() delcommand Var delcommand Winbar - if exists('k_map_saved') - if !empty(k_map_saved) && !k_map_saved.buffer + if k_map_saved isnot null_dict
that is not resolved
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
alright then, thanks. Can you please make the suggested changes from @errael ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
that's a confusion to himself, #15013 (comment) had explained.
// though you accepted his PR vs/over mine in the past about this null/null_obj topic, but just a code style.
// vs this termdebug you had accepted null_obj for saved_mousemodel
, a similar flag, so i just kept the same.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
that's a confusion to himself, #15013 (comment) had explained.
// though you accepted his PR vs/over mine in the past about this null/null_obj topic, but just a code style.
// vs this termdebug you had accepted null_obj for saved_mousemodel
, a similar flag, so i just kept the same.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shane-XB-Qian commented on this pull request.
> @@ -1232,32 +1232,38 @@ def DeleteCommands() delcommand Var delcommand Winbar - if exists('k_map_saved') - if !empty(k_map_saved) && !k_map_saved.buffer + if k_map_saved isnot null_dict
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> nunmap K mapset(k_map_saved) elseif empty(k_map_saved) - nunmap K + silent! nunmap K
ah, okay. So you initialize to null_dict and then testing against null_dict should be correct.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.