New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make references to [range] consistent #13971
base: master
Are you sure you want to change the base?
Conversation
Previously, it referred to information about the range itself ( :range -- a subsection of [range] ) instead of information about the actual command ( :[range] ).
I don't think this makes sense. |
The issue, in my opinion, is that
Additionally, the very helpdocs for
This makes it sound like it should always be denoted as I feel like this unification I proposed makes the most sense overall, though other methods of unification (or clarifying notation/adding synonyms to parts of the helpdocs) might work. |
IMO, if omitting the range leads to completely different behavior, the range isn't really optional. |
This would be consistent with how some commands work which only have a single helpdocs entry for the range variant, while still having the "optional" notation (i.e. Of course, I did not help create the helpdocs over the years, so maybe this is just some artifact of changes in notation and I am misunderstanding things; however, EditI stand corrected; norm does behave differently. This still means that the helpdocs are inconsistent with use of notation, though. |
not really sure it is worth it. Mostly it seems the |
Would it make sense, as an alternative, to have |
yes, makes sense. |
@@ -297,8 +297,8 @@ zf{motion} or | |||
*zF* | |||
zF Create a fold for [count] lines. Works like "zf". | |||
|
|||
:{range}fo[ld] *:fold* *:fo* | |||
Create a fold for the lines in {range}. Works like "zf". | |||
:[range]fo[ld] *:fold* *:fo* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here [range]
is not really optional. Please leave it as before
:{range}foldo[pen][!] | ||
Open folds in {range}. When [!] is added all folds are | ||
opened. Useful to see all the text in {range}. Without [!] | ||
:[range]foldo[pen][!] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
:{range}foldc[lose][!] | ||
Close folds in {range}. When [!] is added all folds are | ||
closed. Useful to hide all the text in {range}. Without [!] | ||
:[range]foldc[lose][!] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -1161,7 +1161,7 @@ The commands are sorted on the non-optional part of their name. | |||
tag command action ~ | |||
------------------------------------------------------------------------------ | |||
|:| : nothing | |||
|:range| :{range} go to last line in {range} | |||
|:[range]| :{range} go to last line in {range} (normally denoted |[range]|) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, [range] is not really optionally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is :range
links to something other than what they were expecting. However, once making {range} point to the same place as [range], this will be easy to resolve.
@@ -2043,7 +2043,7 @@ NOTE: These commands cannot be used with |:global| or |:vglobal|. | |||
the cursor. | |||
See |++opt| for the possible values of [++opt]. | |||
|
|||
:{range}r[ead] [++opt] [name] | |||
:[range]r[ead] [++opt] [name] | |||
Insert the file [name] (default: current file) below | |||
the specified line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below the specified {range} ?
@@ -134,9 +134,9 @@ if your text can't be properly formatted with Vim's builtin command. See the | |||
|
|||
To center a range of lines, use the following command: > | |||
|
|||
:{range}center [width] | |||
:[range]center [width] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really optional from the context above.
@@ -185,7 +185,7 @@ g8 Print the hex values of the bytes used in the | |||
:= [flags] Print the last line number. | |||
See |ex-flags| for [flags]. | |||
|
|||
:{range}= [flags] Prints the last line number in {range}. For example, | |||
:[range]= [flags] Prints the last line number in [range]. For example, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is specifically how the =
command handles the [range]
. So not really optional from the context (else it would be the same as line 185 above).
Execute Normal mode commands {commands} for each line | ||
in the {range}. Before executing the {commands}, the | ||
in the [range]. Before executing the {commands}, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really optional as well.
@@ -76,7 +76,7 @@ static int cause_abort = FALSE; | |||
|
|||
/* | |||
* Return TRUE when immediately aborting on error, or when an interrupt | |||
* occurred or an exception was thrown but not caught. Use for ":{range}call" | |||
* occurred or an exception was thrown but not caught. Use for ":[range]call" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really optional from context.
@@ -437,7 +437,7 @@ next_search_hl( | |||
int called_emsg_before = called_emsg; | |||
int timed_out = FALSE; | |||
|
|||
// for :{range}s/pat only highlight inside the range | |||
// for :[range]s/pat only highlight inside the range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really optional as well from context.
When I get the chance, I will revert the changes specified to stay in accordance to the optional/required syntax. I'll also look through the existing uses of [...] (optional) to make sure they don't need to be converted to required. |
sure thanks. |
Some parts of the vimdocs refer to ranges with
{range}
instead of[range]
. Since there are more instances of[range]
and only information on the[range]
variant exists (:h [range]
and:h :[range]
exist,:h {range}
does not), I made all of the references consistent.The EX commands index is the only instance where it is left as
{range}
but consequently clarified as normally being denoted with[range]
, since that section of the helpdocs uses[...]
to mean optional. ([range]
is not optional for:[range]
, since it would otherwise be:
, which is specified as a separate command.)I also noticed that this line used the wrong tag for the command (it linked to information about ranges,
[range]
, instead of information about the command:[range]
).Below is context for what I am referring to (with my proposed changes included):