[vim/vim] [Proposal] built-in function mode(1) impovement (#2745)

62 views
Skip to first unread message

h_east

unread,
Mar 23, 2018, 12:36:08 PM3/23/18
to vim/vim, Subscribed

Hi Bram and list,

I added a state of recording into register and/or executing the register to built-in function mode(1).
See the modified document in the patch.

How about this?
Possibly, should we add another function?

--
Best regards,
Hirohito Higashi (h_east)


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

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

Commit Summary

  • [Proposal] built-in function mode(1) impovement

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Codecov

unread,
Mar 23, 2018, 12:54:50 PM3/23/18
to vim/vim, Subscribed

Codecov Report

Merging #2745 into master will increase coverage by <.01%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2745      +/-   ##
==========================================
+ Coverage      75%   75.01%   +<.01%     
==========================================
  Files          92       92              
  Lines      134183   134188       +5     
==========================================
+ Hits       100643   100657      +14     
+ Misses      33540    33531       -9
Impacted Files Coverage Δ
src/evalfunc.c 83.61% <69.23%> (+0.01%) ⬆️
src/ex_cmds.c 79.39% <0%> (-0.23%) ⬇️
src/misc1.c 84.34% <0%> (-0.07%) ⬇️
src/term.c 60.21% <0%> (ø) ⬆️
src/if_py_both.h 76.59% <0%> (ø) ⬆️
src/screen.c 77.45% <0%> (+0.02%) ⬆️
src/syntax.c 78.27% <0%> (+0.02%) ⬆️
src/normal.c 73.13% <0%> (+0.02%) ⬆️
src/channel.c 82.79% <0%> (+0.04%) ⬆️
src/os_unix.c 54.61% <0%> (+0.13%) ⬆️
... and 4 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 295ac5a...635d3b0. Read the comment docs.

Bram Moolenaar

unread,
Mar 23, 2018, 5:57:43 PM3/23/18
to vim/vim, Subscribed

Hirohito Higashi wrote:

> I added a state of recording into register and/or executing the register to built-in function mode(1).
> See the modified document in the [patch](https://github.com/vim/vim/compare/master...h-east:proposal_mode_function_improvement?expand=1#diff-bea881dfa9626bab7141337b0fcdb23e).
>
> How about this?
> Possibly, should we add another function?

Yeah, this is not part of the mode, this state doesn't change what
commands will do.

Perhaps recording() can return the register name and executing() can
return one or zero.

--
Microsoft is to software what McDonalds is to gourmet cooking

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

h_east

unread,
Mar 24, 2018, 6:26:18 AM3/24/18
to vim/vim, Push

@h-east pushed 4 commits.

  • 23f8109 Merge remote-tracking branch 'root_branch/master' into proposal_mode_function_improvement
  • 850787c Revert "[Proposal] built-in function mode(1) impovement"
  • d895946 Add built-in functions register_executing() and register_recording()
  • 936449a Add a test and doc


You are receiving this because you are subscribed to this thread.

View it on GitHub

h_east

unread,
Mar 24, 2018, 6:30:48 AM3/24/18
to vim/vim, Subscribed

I reverted mode() modification and added function register_executing() and register_recording().

h_east

unread,
Mar 24, 2018, 6:36:07 AM3/24/18
to vim_dev
Hi Bram and list,

Subject changed.

Bram Moolenaar

unread,
Mar 24, 2018, 9:15:11 AM3/24/18
to vim/vim, Subscribed

> I reverted `mode()` modification and added function
> `register_executing()` and `register_recording()`.

Looks OK, but the names are a bit long. How about reg_executing() and
reg_recording()? That's clear enough, right?

We could make them event a bit short:
reg_excute()
reg_record()
But that sounds like actions, not a good choice.

--
hundred-and-one symptoms of being an internet addict:
48. You get a tatoo that says "This body best viewed with Netscape 3.1 or
higher."


/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

h_east

unread,
Mar 24, 2018, 9:30:44 AM3/24/18
to vim/vim, Push

@h-east pushed 2 commits.

  • a8fd370 Merge remote-tracking branch 'root_branch/master' into proposal_mode_function_improvement
  • a84e756 Rename the function name short.


You are receiving this because you are subscribed to this thread.

View it on GitHub

h_east

unread,
Mar 24, 2018, 9:32:04 AM3/24/18
to vim/vim, Subscribed

Rename function name to reg_executing() and reg_recording() 👍

xtal8

unread,
Mar 24, 2018, 9:54:56 AM3/24/18
to vim/vim, Subscribed

@xtal8 commented on this pull request.


In runtime/doc/usr_41.txt:

> @@ -1016,6 +1016,8 @@ Various:					*various-functions*
 	getreg()		get contents of a register
 	getregtype()		get type of a register
 	setreg()		set contents and type of a register
+	regster_executing()	return the state of the register executing

s/regster/reg

xtal8

unread,
Mar 24, 2018, 9:56:09 AM3/24/18
to vim/vim, Subscribed

@xtal8 commented on this pull request.


In runtime/doc/usr_41.txt:

> @@ -1016,6 +1016,8 @@ Various:					*various-functions*
 	getreg()		get contents of a register
 	getregtype()		get type of a register
 	setreg()		set contents and type of a register
+	regster_executing()	return the state of the register executing
+	regster_recording()	return the state of the register recording

s/regster/reg

h_east

unread,
Mar 24, 2018, 9:57:57 AM3/24/18
to vim/vim, Push

@h-east pushed 1 commit.

  • 8c16b38 Fixed omission of function name change.


You are receiving this because you are subscribed to this thread.

View it on GitHub

h_east

unread,
Mar 24, 2018, 9:58:36 AM3/24/18
to vim/vim, Subscribed

@xtal8 Thanks! I fixed.

Bram Moolenaar

unread,
May 22, 2018, 2:36:17 PM5/22/18
to vim/vim, Subscribed

Closed #2745 via 0b6d911.

Andy Massimino

unread,
May 23, 2018, 8:41:14 PM5/23/18
to vim/vim, Subscribed

This is really neat! Of course, the only thing missing now is an autocmd or two on "start recording" and "stop recording" :).

Reply all
Reply to author
Forward
0 new messages