https://github.com/vim/vim/pull/15032
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@yegappan Could you please check with your setting of g:termdebug_config['wide']
if you get the desired result? That feature is a bit difficult to test through unit testing.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@ubaldot pushed 1 commit.
—
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:
> - elseif empty(plus_map_saved) - silent! nunmap + - endif - plus_map_saved = null_dict - endif - if minus_map_saved isnot null_dict - if !empty(minus_map_saved) && minus_map_saved.buffer - # pass - elseif !empty(minus_map_saved) && !minus_map_saved.buffer - nunmap - - mapset(minus_map_saved) - elseif empty(minus_map_saved) - silent! nunmap - - endif - minus_map_saved = null_dict + if !empty(saved_k_map)
you dropped the !k_map_saved.buffer
intentionally here?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@ubaldot commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> - elseif empty(plus_map_saved) - silent! nunmap + - endif - plus_map_saved = null_dict - endif - if minus_map_saved isnot null_dict - if !empty(minus_map_saved) && minus_map_saved.buffer - # pass - elseif !empty(minus_map_saved) && !minus_map_saved.buffer - nunmap - - mapset(minus_map_saved) - elseif empty(minus_map_saved) - silent! nunmap - - endif - minus_map_saved = null_dict + if !empty(saved_k_map)
Yes. The logic now is much easier and it goes like the following:
The empty condition is a guard in case the saved_k_map
is empty. In that case mapset
would return an error.
—
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:
> - elseif empty(plus_map_saved) - silent! nunmap + - endif - plus_map_saved = null_dict - endif - if minus_map_saved isnot null_dict - if !empty(minus_map_saved) && minus_map_saved.buffer - # pass - elseif !empty(minus_map_saved) && !minus_map_saved.buffer - nunmap - - mapset(minus_map_saved) - elseif empty(minus_map_saved) - silent! nunmap - - endif - minus_map_saved = null_dict + if !empty(saved_k_map)
But the problem is, if the mapping was a buffer-local (the buffer
key is set) mapping, we may restore it wrongly here (because it get's re-created in the wrong buffer).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@ubaldot commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> - elseif empty(plus_map_saved) - silent! nunmap + - endif - plus_map_saved = null_dict - endif - if minus_map_saved isnot null_dict - if !empty(minus_map_saved) && minus_map_saved.buffer - # pass - elseif !empty(minus_map_saved) && !minus_map_saved.buffer - nunmap - - mapset(minus_map_saved) - elseif empty(minus_map_saved) - silent! nunmap - - endif - minus_map_saved = null_dict + if !empty(saved_k_map)
Correct. The maparg only stores info if the mapping was buffer-local but not to what buffer it relates. I'll look into that. Thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@ubaldot commented on this pull request.
In runtime/pack/dist/opt/termdebug/plugin/termdebug.vim:
> - elseif empty(plus_map_saved) - silent! nunmap + - endif - plus_map_saved = null_dict - endif - if minus_map_saved isnot null_dict - if !empty(minus_map_saved) && minus_map_saved.buffer - # pass - elseif !empty(minus_map_saved) && !minus_map_saved.buffer - nunmap - - mapset(minus_map_saved) - elseif empty(minus_map_saved) - silent! nunmap - - endif - minus_map_saved = null_dict + if !empty(saved_k_map)
Done! Check it now. I also updated the related variables names with capital letter for K
since it is K
mapping and not k
.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
thanks. I'd like that you include a new test!
—
Reply to this email directly, view it on GitHub.
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.
thanks. I'd like that you include a new test!
Sure thing!
I'll add it tomorrow. :)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
😆 What I was trying to say: "Thanks for adding a test for the save/restore function". But I take more tests ;)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
😀 ok! Yet, the use-case you raised is not covered by any test, otherwise some test must have failed before you notice the bug. Better add one test ;)
Related: I don't know what is your take on that 'maparg' store if a mapping has buffer scope but not the related buffer number/name. Is it worth opening an issue labeled as enhancement?
—
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.