https://github.com/vim/vim/pull/10273
(5 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@errael pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Merging #10273 (e1918ae) into master (ac92ab7) will increase coverage by
1.44%.
The diff coverage is88.00%.
@@ Coverage Diff @@ ## master #10273 +/- ## ========================================== + Coverage 81.00% 82.44% +1.44% ========================================== Files 161 148 -13 Lines 185553 171660 -13893 Branches 41946 38812 -3134 ========================================== - Hits 150301 141533 -8768 + Misses 22742 17516 -5226 - Partials 12510 12611 +101
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | 82.44% <88.00%> (+<0.01%) |
⬆️ |
| linux | 82.44% <88.00%> (+<0.01%) |
⬆️ |
| 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/evalfunc.c | 89.44% <ø> (-1.19%) |
⬇️ |
| src/map.c | 86.73% <88.00%> (-1.69%) |
⬇️ |
| src/highlight.c | 78.57% <0.00%> (-2.67%) |
⬇️ |
| src/time.c | 86.93% <0.00%> (-2.38%) |
⬇️ |
| src/buffer.c | 84.08% <0.00%> (-2.36%) |
⬇️ |
| src/misc2.c | 86.55% <0.00%> (-2.34%) |
⬇️ |
| src/help.c | 79.89% <0.00%> (-2.20%) |
⬇️ |
| src/libvterm/src/screen.c | 51.96% <0.00%> (-2.04%) |
⬇️ |
| src/session.c | 62.83% <0.00%> (-2.01%) |
⬇️ |
| src/menu.c | 81.02% <0.00%> (-1.87%) |
⬇️ |
| ... and 133 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 ac92ab7...e1918ae. 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.![]()
@yegappan commented on this pull request.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
All the map related functions start with the map prefix. To be consistent, this function should
be called mapget().
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
+ Returns a |List| of all mappings. Each List item is a |Dict|
+ as defined by |maparg()|. For a given mapping, the Dict from
+ getmaps() is identical to the dict from |maparg()|.
A user can use the Dict returned by getmaps() and call mapset() to recreate the mapping?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
"maps" isn't commonly used, let's call this "getmappings".
—
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.![]()
@brammool commented on this pull request.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
Except hasmapto(). It would be nice to start with "map", but what to call it then? mapgetall() ? maplist()?
mapget() suggests getting one mapping.
I used getmappings() for now.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
+ Returns a |List| of all mappings. Each List item is a |Dict|
+ as defined by |maparg()|. For a given mapping, the Dict from
+ getmaps() is identical to the dict from |maparg()|.
I would think the {mode} argument to mapset() could be a special value and then the "mode" from the dict is uesd.
The new function should also have an "abbr" optional argument to get a list of abbreviations instead of mappings.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@LemonBoy commented on this pull request.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
Given the presence of getloclist I'd say getmaplist is the name that fits best the existing functions.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@brammool commented on this pull request.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()* :echo getloclist(5, {'filewinid': 0}) +getmaps() *getmaps()*Except hasmapto(). It would be nice to start with "map", but what to call it then? mapgetall() ? maplist()?
mapget() suggests getting one mapping.
I used getmappings() for now.
—
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.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
+ Returns a |List| of all mappings. Each List item is a |Dict|
+ as defined by |maparg()|. For a given mapping, the Dict from
+ getmaps() is identical to the dict from |maparg()|.
The test does assert_equal(getmaps_entry, maparg_return) for all mappings; how could it not work? (Famous last words)
have an "abbr" optional argument
And here we go... :-)
So getmappings([{abbr}]), if abbr true, then return the abbreviations.
It could be getmappings({dict}), where the key abbr can be true/false. Just in case there's more options on the way. With that in mind, I'm in favor of just an optional bool for abbreviations.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
I'll sit on this for a day, planning on
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@errael commented on this pull request.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
+ Returns a |List| of all mappings. Each List item is a |Dict|
+ as defined by |maparg()|. For a given mapping, the Dict from
+ getmaps() is identical to the dict from |maparg()|.
I would think the {mode} argument to mapset() could be a special value and then the "mode" from the dict is uesd.
I would suggest mapset({dict}) means take abbr and mode from dict, that's easy for a user to understand.
It's unclear to me, whether or not mapcheck() would want a similar change.
Either way, is there a reason not to include "abbr: true/false" in the mapping-dict? I think it could be done right now, without any negative consequences. I'm guessing mapset() wouldn't care today.
I'm a casual vim user, so I'm mostly clueless about a lot of vim stuff. Considering the above, and playing with the new maplist() function, I did the following experiment because I was trying to figure out where nox came from for the Q mapping. I'm sure whatever drives having [on]unmap also implicitly do sunmap gives a better user experience.
map X xyzzy [' ']
nunmap X ['ov']
map X xyzzy [' ']
xunmap X ['nos']
map X xyzzy [' ']
sunmap X ['nox']
map X xyzzy [' ']
ounmap X ['nv']
map X xyzzy [' ']
sunmap X ['nox']
smap X xyzzy ['s', 'nox']
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@errael commented on this pull request.
> @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}]) *getloclist()*
:echo getloclist(5, {'filewinid': 0})
+getmaps() *getmaps()*
+ Returns a |List| of all mappings. Each List item is a |Dict|
+ as defined by |maparg()|. For a given mapping, the Dict from
+ getmaps() is identical to the dict from |maparg()|.
If overloading functions is philosophically undesirable, mapset(null, null, dict) is a possibility.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()