[vim/vim] Add 'showcmd' statusline item (PR #11684)

94 views
Skip to first unread message

luukvbaal

unread,
Dec 9, 2022, 8:15:59 AM12/9/22
to vim/vim, Subscribed

This statusline item is mostly intended for use with cmdheight == 0 in Neovim. Nevertheless, users have expressed interest in displaying showcmd in their statusline and even tabline.

Just checking if you are open to including this to avoid future naming conflicts of the statusline item. The item name is still up for debate, @justinmk suggested dot. instead.

I assume potential users of this item would set noshowcmd, therefore I decoupled the showcmd routines from p_sc, except for the actual drawing in the cmdline.

I tried adding a non-screendump test to Test_statusline() but only the visual mode test passes. The pending operator test yields an empty statusline. Does the call assert_match() clear the showcmd buffer? That's what it seems like atleast:

  " %S: 'showcmd' content.
  set statusline=%S
  call assert_match('^\s*$', s:get_statusline())
  call feedkeys("\<C-V>l", "xt")
  call assert_match('^1x2\s*$', s:get_statusline())
  call feedkeys("\<Esc>1234", "xt")
  call assert_match('^1234\s*$', s:get_statusline())
  call feedkeys("\<Esc>", "xt")
  " result:
  " RunTheTest[44]..Test_statusline line 130: Pattern '^\\[1234\\]s*$' does not match '\[  occurs 80 times]'

Therefore I grouped them as 2 screendump tests instead. It works as intended in practice.

Redrawing the statusline upon command input caused a test failure in Test_aa_terminal_focus_events(), updated the dump files to reflect the statusline update.


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

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

Commit Summary

  • 3f37edc Add 'showcmd' statusline item

File Changes

(9 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/11684@github.com>

zeertzjq

unread,
Dec 9, 2022, 8:24:11 AM12/9/22
to vim/vim, Subscribed

feedkeys() with x flag needs to cancel pending operator to finish, so it is not possible to stop at op-pending mode after that. I guess it may be possible to check the screen in op-pending mode using timers, but that may make the test confusing.


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/11684/c1344306749@github.com>

codecov[bot]

unread,
Dec 9, 2022, 8:27:48 AM12/9/22
to vim/vim, Subscribed

Codecov Report

Merging #11684 (3f37edc) into master (98aeb21) will decrease coverage by 29.15%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@

##           master   #11684       +/-   ##

===========================================

- Coverage   81.81%   52.65%   -29.16%     

===========================================

  Files         164      154       -10     

  Lines      190973   177580    -13393     

  Branches    43370    40766     -2604     

===========================================

- Hits       156242    93508    -62734     

- Misses      22046    76342    +54296     

+ Partials    12685     7730     -4955     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui 53.02% <0.00%> (+<0.01%) ⬆️
huge-gcc-unittests 0.29% <0.00%> (ø)
linux 52.65% <0.00%> (-29.80%) ⬇️
mingw-x64-HUGE ?
mingw-x86-HUGE ?
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/buffer.c 36.66% <0.00%> (-50.69%) ⬇️
src/drawscreen.c 80.18% <ø> (-1.07%) ⬇️
src/normal.c 0.12% <0.00%> (-90.85%) ⬇️
src/misc2.c 0.00% <0.00%> (-89.48%) ⬇️
src/regexp_bt.c 0.00% <0.00%> (-85.97%) ⬇️
src/popupwin.c 1.62% <0.00%> (-85.15%) ⬇️
src/search.c 0.49% <0.00%> (-84.70%) ⬇️
src/json.c 3.22% <0.00%> (-80.09%) ⬇️
src/spell.c 2.19% <0.00%> (-79.65%) ⬇️
... and 147 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


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/11684/c1344310333@github.com>

luukvbaal

unread,
Dec 9, 2022, 8:30:57 AM12/9/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 4a1e041 Add 'showcmd' statusline item


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11684/push/11942231681@github.com>

zeertzjq

unread,
Dec 9, 2022, 8:30:59 AM12/9/22
to vim/vim, Subscribed

updated the dump files to reflect the statusline update.

Did you forget to git add the updated dump files?


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/11684/c1344313425@github.com>

Bram Moolenaar

unread,
Dec 9, 2022, 9:36:09 AM12/9/22
to vim/vim, Subscribed

Please first add documentation. Reverse engineering the code to guess what it's supposed to do isn't the right way to add a new feature.
One problem I can spot is that it's redrawing the status lines even when the showcmd item isn't in there.
Also, what happens when 'showcmd' is off is unclear.


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/11684/c1344383859@github.com>

luukvbaal

unread,
Dec 9, 2022, 11:17:17 AM12/9/22
to vim/vim, Subscribed

Please first add documentation.

Right, completely forgot sorry.

One problem I can spot is that it's redrawing the status lines even when the showcmd item isn't in there.

True, should 'statusline' be parsed for this item? Is there precedent for this?

Also, what happens when 'showcmd' is off is unclear.

When 'showcmd' is off, we still fill the showcmd_buf, because the user might have the item in use. If we parse the status/tabline we could set a global and avoid unnecessary work I guess.


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/11684/c1344497638@github.com>

luukvbaal

unread,
Dec 9, 2022, 11:17:18 AM12/9/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • a500f6b Add 'showcmd' statusline item

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

luukvbaal

unread,
Dec 9, 2022, 12:39:18 PM12/9/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 27be343 Add 'showcmd' statusline item

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

luukvbaal

unread,
Dec 9, 2022, 12:41:43 PM12/9/22
to vim/vim, Subscribed

If we parse the status/tabline we could set a global and avoid unnecessary work I guess.

I guess there's no reason not to, latest commit sets a global boolean when the 'showcmd' item is encountered. Status line will only be redrawn when TRUE, so reverted the terminal focus testdump change.


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/11684/c1344583796@github.com>

luukvbaal

unread,
Dec 9, 2022, 12:49:13 PM12/9/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 29c0e80 Add 'showcmd' statusline item

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

Bram Moolenaar

unread,
Dec 9, 2022, 2:26:42 PM12/9/22
to vim/vim, Subscribed


> > Please first add documentation.
>
> Right, completely forgot sorry.
>
> > One problem I can spot is that it's redrawing the status lines even when the showcmd item isn't in there.
>
> True, should 'statusline' be parsed for this item? Is there precedent
> for this?

I don't think so. Currently there is no item that changes on every key
stroke, AFAIK.

Parsing the option only works when when it doesn't start with "!%".
I think the only way would be to draw the status line, and set a flag if
the "showcmd" value is used. But then perhaps it isn't always called
(e.g. if there is not enough room), that makes it unreliable.


> > Also, what happens when 'showcmd' is off is unclear.
>
> When 'showcmd' is off, we still fill the `showcmd_buf`, because the
> user might have the item in use. If we parse the status/tabline we

> could set a global and avoid unnecessary work I guess.

If 'showcmd' would have been a number or string option we could have
done something, but since it's a boolean we can't change it.

We could tackle both problems with a 'showcmdwhere' option (better
name?), to tell Vim where the command will be displayed, thus knowing
when to update status lines. Since the user has to switch 'showcmd'
off, setting another option isn't really a problem.

--
MAN: You don't frighten us, English pig-dog! Go and boil your bottoms,
son of a silly person. I blow my nose on you, so-called Arthur-king,
you and your silly English K...kaniggets.
He puts hands to his ears and blows a raspberry.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11684/c1344688742@github.com>

luukvbaal

unread,
Dec 9, 2022, 6:48:38 PM12/9/22
to vim/vim, Subscribed

Parsing the option only works when when it doesn't start with "!%". I think the only way would be to draw the status line, and set a flag if the "showcmd" value is used.

Yeah I realized, the latest commit does just that.

We could tackle both problems with a 'showcmdwhere' option (better
name?), to tell Vim where the command will be displayed, thus knowing when to update status lines.

Right, let me know if that is a route you want to take to include this feature. I can update accordingly. Do we want to facilitate displaying this item in both the status line and tabline? Or even multiple(status/tab/cmdline) at the same time? In which case I suppose it should be a comma separated string option.

Since the user has to switch 'showcmd' off, setting another option isn't really a problem.

I guess in theory they don't have to but it would make the most sense yeah.


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/11684/c1344893942@github.com>

Bram Moolenaar

unread,
Dec 10, 2022, 6:17:22 AM12/10/22
to vim/vim, Subscribed


> > Parsing the option only works when when it doesn't start with "!%".
> > I think the only way would be to draw the status line, and set a
> > flag if the "showcmd" value is used.
>
> Yeah I realized, the latest commit does just that.
>
> > We could tackle both problems with a 'showcmdwhere' option (better
> >name?), to tell Vim where the command will be displayed, thus knowing
> >when to update status lines.
>
> Right, let me know if that is a route you want to take to include this
> feature. I can update accordingly. Do we want to facilitate displaying
> this item in both the status line and tabline? Or even
> multiple(status/tab/cmdline) at the same time? In which case I suppose
> it should be a comma separated string option.

Would someone really want it in multiple places? That sounds unusual.
I would not implement that at first, but make the option value in a way
that it's possible in the future.

When you say "status line" it doesn't say where it shows up. Only the
status line for the most bottom-right window? Otherwise it's specified
by the 'statusline' option. But it could also be done when 'statusline'
is empty.

I find it hard to imagine showcmd showing up in the tabline. I suppose
some space would need to be reserved for it. Then the choice is on the
far left or the far right.


> > Since the user has to switch 'showcmd' off, setting another option
> > isn't really a problem.
>
> I guess in theory they don't **have** to but it would make the most
> sense yeah.

With the extra option, probably 'showcmdloc', then 'showcmd' would still
be on. If it is off then it won't show anywhere. That's simple.

'showcmdloc' would now be one word, such as "statusline",
"tablineright", etc. If we ever would want to show it in more than one
place the option can become a comma separated list of these words.

I still have the feeling that very few users are going to use this, thus
consider it low priority.

--
ARTHUR: (as the MAN next to him is squashed by a sheep) Knights! Run away!
Midst echoing shouts of "run away" the KNIGHTS retreat to cover with the odd
cow or goose hitting them still. The KNIGHTS crouch down under cover.

"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11684/c1345241857@github.com>

luukvbaal

unread,
Dec 10, 2022, 6:37:24 AM12/10/22
to vim/vim, Subscribed

Would someone really want it in multiple places? That sounds unusual.
I would not implement that at first, but make the option value in a way
that it's possible in the future.

When you say "status line" it doesn't say where it shows up. Only the
status line for the most bottom-right window? Otherwise it's specified
by the 'statusline' option. But it could also be done when 'statusline'
is empty.

I find it hard to imagine showcmd showing up in the tabline. I suppose
some space would need to be reserved for it. Then the choice is on the
far left or the far right.

Yes showing it in multiple places would be unusual. The way I implemented it currently and what seems to make the most sense to me is to redraw the status line for curwin. Whether it shows up is not our concern I don't think. It would indeed be up to the user to reserve space, if they find the item high enough priority.

With the extra option, probably 'showcmdloc', then 'showcmd' would still
be on. If it is off then it won't show anywhere. That's simple.

'showcmdloc' would now be one word, such as "statusline",
"tablineright", etc. If we ever would want to show it in more than one
place the option can become a comma separated list of these words.

I still have the feeling that very few users are going to use this, thus
consider it low priority.

Very possible, again I only made the PR here to avoid future naming conflicts with Neovim, and get a feel for what item-symbol you would choose. But if we are going to add the feature here we have to add it in a way that makes sense. I think we may not need the 'showcmdloc' option. Since we now pass the option name to build_stl_str_hl(), we can simply set a flag for status/tabline and redraw accordingly in display_showcmd().


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/11684/c1345245189@github.com>

Bram Moolenaar

unread,
Dec 10, 2022, 7:27:59 AM12/10/22
to vim/vim, Subscribed


> Yes showing it in multiple places would be unusual. The way I
> implemented it currently and what seems to make the most sense to me
> is to redraw the status line for `curwin`. Whether it shows up is not

> our concern I don't think. It would indeed be up to the user to
> reserve space, if they find the item high enough priority.

It does make sense to show it in the current window. That's closest to
where the user is looking.

When 'statusline' is empty it should still show up. Left of the ruler
would be good.

> Very possible, again I only made the PR here to avoid future naming

> conflicts with Neovim, and get a feel for what item-symbol you would
> choose. But if we are going to add the feature here we have to add it
> in a way that makes sense. I think we may not need the 'showcmdloc'
> option. Since we now pass the option name to `build_stl_str_hl()`, we

> can simply set a flag for status/tabline and redraw accordingly in
> `display_showcmd()`.

In my opinion we do need to add the 'showcmdloc' option. Without it,
the user would have to reset 'showcmd' and add the item to the
'statusline' option. This would black adding 'showcmdloc' later,
because then 'showcmd' would remain on, thus it can't be backwards
compatible.

--
In his lifetime van Gogh painted 486 oil paintings. Oddly enough, 8975
of them are to be found in the United States.


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11684/c1345254288@github.com>

Bram Moolenaar

unread,
Dec 10, 2022, 8:19:20 AM12/10/22
to vim/vim, Subscribed


I wrote:

> > Yes showing it in multiple places would be unusual. The way I
> > implemented it currently and what seems to make the most sense to me
> > is to redraw the status line for `curwin`. Whether it shows up is not
> > our concern I don't think. It would indeed be up to the user to
> > reserve space, if they find the item high enough priority.
>
> It does make sense to show it in the current window. That's closest to
> where the user is looking.
>
> When 'statusline' is empty it should still show up. Left of the ruler
> would be good.
>
> > Very possible, again I only made the PR here to avoid future naming
> > conflicts with Neovim, and get a feel for what item-symbol you would
> > choose. But if we are going to add the feature here we have to add it
> > in a way that makes sense. I think we may not need the 'showcmdloc'
> > option. Since we now pass the option name to `build_stl_str_hl()`, we
> > can simply set a flag for status/tabline and redraw accordingly in
> > `display_showcmd()`.
>
> In my opinion we do need to add the 'showcmdloc' option. Without it,
> the user would have to reset 'showcmd' and add the item to the
> 'statusline' option. This would black adding 'showcmdloc' later,

s/black/block/


> because then 'showcmd' would remain on, thus it can't be backwards
> compatible.

--
press CTRL-ALT-DEL for more information


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11684/c1345263588@github.com>

luukvbaal

unread,
Dec 10, 2022, 1:26:31 PM12/10/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 56879bd Add 'showcmd' statusline item

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

luukvbaal

unread,
Dec 10, 2022, 1:30:28 PM12/10/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 933b7b3 Add 'showcmd' statusline item and 'showcmdloc' option

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

luukvbaal

unread,
Dec 10, 2022, 1:47:48 PM12/10/22
to vim/vim, Subscribed

When 'statusline' is empty it should still show up. Left of the ruler would be good.

Latest commit adds the 'showcmdloc' option. Will need to figure out how to add this to the default statusline if 'showcmdloc' == "statusline".


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/11684/c1345360253@github.com>

luukvbaal

unread,
Dec 10, 2022, 8:06:57 PM12/10/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • e182aee Add 'showcmd' statusline item and 'showcmdloc' option

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

luukvbaal

unread,
Dec 10, 2022, 8:11:10 PM12/10/22
to vim/vim, Subscribed

Will need to figure out how to add this to the default statusline if 'showcmdloc' == "statusline".

Done in the latest commit, as well as for the default tabline. (I don't see it being all that useful in the tabline, I just added it because I came across https://vi.stackexchange.com/questions/16857/showcmd-on-first-line-instead-of-last-line).

I think the attributes for the showcmd text in the default tabline should be attr_nosel without underline. I tried attr_nosel & ~HL_UNDERLINE but that also changed the color. Any way I can use attr_nosel but remove the underline?


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/11684/c1345425328@github.com>

luukvbaal

unread,
Dec 11, 2022, 9:00:40 AM12/11/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 0c887fd Add 'showcmd' statusline item and 'showcmdloc' option

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

luukvbaal

unread,
Dec 11, 2022, 7:58:29 PM12/11/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 2673ca4 Add 'showcmd' statusline item and 'showcmdloc' option

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

luukvbaal

unread,
Dec 11, 2022, 8:08:22 PM12/11/22
to vim/vim, Subscribed

Any way I can use attr_nosel but remove the underline?

I guess it doesn't make sense to forcefully remove the underline from a highlight group (didn't actually figure out how to do that). This is finished then as far as I'm concerned. Tests for the default status/tabline are still missing. If you are open to including this in it's current form I could add additional tests.


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/11684/c1345728475@github.com>

Bram Moolenaar

unread,
Dec 13, 2022, 9:23:04 AM12/13/22
to vim/vim, Subscribed

I thought I had already mentioned this: when 'showcmd' is off then the command should not be displayed anywhere.
It is too surprising that with 'noshowcmd' and then 'showcmdloc' set the command shows anyway.

The default value for 'showcmdloc' should be "last". Currently you could replace it with "statusline" or "tabline".
If we ever decide to show it in multiple places, it could be "last,statusline", for example.

Coding style: Please put the opening curly on the next line.


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/11684/c1348674940@github.com>

luukvbaal

unread,
Dec 13, 2022, 9:54:11 AM12/13/22
to vim/vim, Subscribed

@luukvbaal commented on this pull request.


In src/buffer.c:

> @@ -4775,6 +4775,11 @@ build_stl_str_hl(
 	    get_rel_pos(wp, str, TMPLEN);
 	    break;
 
+	case STL_SHOWCMD:
+	    if (p_sc && STRCMP(opt_name, p_sloc) == 0)
case STL_SHOWCMD:
	    if (p_sc && STRCMP(opt_name, p_sloc) == 0)
		str = showcmd_buf;
	    break;

Not sure if this check is needed, I think showcmd_buf will always be empty here if those conditions are false anyways.


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/11684/review/1215644243@github.com>

luukvbaal

unread,
Dec 13, 2022, 10:10:55 AM12/13/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • e5dc80d Add 'showcmd' statusline item and 'showcmdloc' option

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

luukvbaal

unread,
Dec 13, 2022, 10:11:28 AM12/13/22
to vim/vim, Subscribed

I thought I had already mentioned this: when 'showcmd' is off then the command should not be displayed anywhere.
It is too surprising that with 'noshowcmd' and then 'showcmdloc' set the command shows anyway.

The default value for 'showcmdloc' should be "last". Currently you could replace it with "statusline" or "tabline".
If we ever decide to show it in multiple places, it could be "last,statusline", for example.

Coding style: Please put the opening curly on the next line.

Done and additional tests added.


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/11684/c1348769858@github.com>

luukvbaal

unread,
Dec 13, 2022, 7:11:24 PM12/13/22
to vim/vim, Push

@luukvbaal pushed 1 commit.

  • 1d5eacf Add 'showcmd' statusline item and 'showcmdloc' option

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

luukvbaal

unread,
Dec 14, 2022, 5:44:31 AM12/14/22
to vim/vim, Subscribed

Should the tests be in test_normal.vim instead? Existing showcmd test is in there.


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/11684/c1350879049@github.com>

Bram Moolenaar

unread,
Dec 14, 2022, 8:51:26 AM12/14/22
to vim/vim, Subscribed


> Should the tests be in `test_normal.vim` instead? Existing `showcmd`
> test is in there.

test_normal.vim is already very big. Perhaps we have enough testing for
this feature to justify a new test file? In the past we thought the
overhead of starting a new Vim instance would matter, but now it matters
more that if a test fails, e.g. there is a memory leak, it is limited in
what might cause it.

Otherwise, test_statusline.vim would also be related.

--
E M A C S
s e l o h
c t t n i
a a t f
p r t
e o
l


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11684/c1351393854@github.com>

luukvbaal

unread,
Dec 14, 2022, 9:05:19 AM12/14/22
to vim/vim, Subscribed

test_normal.vim is already very big. Perhaps we have enough testing for this feature to justify a new test file? In the past we thought the overhead of starting a new Vim instance would matter, but now it matters more that if a test fails, e.g. there is a memory leak, it is limited in what might cause it. Otherwise, test_statusline.vim would also be related.

Yeah depends on whether you want to group these tests under 'showcmd', in which case a test_showcmd.vim might be warranted. Currently I have placed the showcmdloc=statusline test in test_statusline.vim and the showcmdloc=tabline in tabline.vim, your call.


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/11684/c1351416036@github.com>

luukvbaal

unread,
Dec 14, 2022, 10:42:16 AM12/14/22
to vim/vim, Subscribed

I wonder if adding a builtin showcmd() function, analogous to e.g. mode() and searchcount() will be more useful/idiomatic than adding a statusline item?


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/11684/c1351659778@github.com>

Bram Moolenaar

unread,
Dec 15, 2022, 7:51:21 AM12/15/22
to vim/vim, Subscribed


> I wonder if adding a builtin `showcmd()` function, analogous to e.g.
> `mode()` and `searchcount()` will be more useful/idiomatic than adding
> a statusline item?

It looks like it is hardly any code. We can just do both.

Let me include it now. Then we can have some users try it out and see
if we need some adjustments.

--
You had connectors? Eeee, when I were a lad we 'ad to carry the
bits between the computer and the terminal with a spoon...


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11684/c1353015548@github.com>

Bram Moolenaar

unread,
Dec 15, 2022, 8:18:08 AM12/15/22
to vim/vim, Subscribed

Closed #11684 via ba936f6.


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/11684/issue_event/8047179208@github.com>

Reply all
Reply to author
Forward
0 new messages