Patch to support +line
Этот коммит содержится в:
родитель
b5ce81ac16
Коммит
b8c215a830
22
doc/mc.1.in
22
doc/mc.1.in
@ -81,7 +81,7 @@ alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'
|
|||||||
I know the bash function could be shorter for zsh and bash but the
|
I know the bash function could be shorter for zsh and bash but the
|
||||||
backquotes on bash won't accept your suspension the program with
|
backquotes on bash won't accept your suspension the program with
|
||||||
C-z. The temporary file is created in the private directory ~/.mc/tmp
|
C-z. The temporary file is created in the private directory ~/.mc/tmp
|
||||||
in order to avoid symlink attachs in a world writable /tmp.
|
in order to avoid symlink attacks in a world writable /tmp.
|
||||||
.TP
|
.TP
|
||||||
.I "\-s"
|
.I "\-s"
|
||||||
Turns on the slow terminal mode, in this mode the program will not
|
Turns on the slow terminal mode, in this mode the program will not
|
||||||
@ -1461,7 +1461,7 @@ with '#', space or tab.
|
|||||||
.PP
|
.PP
|
||||||
.SH " Options Menu"
|
.SH " Options Menu"
|
||||||
The Midnight Commander has some options that may be toggled on and
|
The Midnight Commander has some options that may be toggled on and
|
||||||
off in several dialogs which are accessible from this menue. Options
|
off in several dialogs which are accessible from this menu. Options
|
||||||
are enabled if they have an asterisk or "x" in front of them.
|
are enabled if they have an asterisk or "x" in front of them.
|
||||||
.PP
|
.PP
|
||||||
The
|
The
|
||||||
@ -1530,7 +1530,7 @@ a dot (like ls -a).
|
|||||||
By default when you mark a file (with either C-t or the Insert key)
|
By default when you mark a file (with either C-t or the Insert key)
|
||||||
the selection bar will move down.
|
the selection bar will move down.
|
||||||
.PP
|
.PP
|
||||||
.I Drop down menues.
|
.I Drop down menus.
|
||||||
When this option is enabled, when you press the
|
When this option is enabled, when you press the
|
||||||
.B F9
|
.B F9
|
||||||
key, the pull down menus will be activated, else, you will
|
key, the pull down menus will be activated, else, you will
|
||||||
@ -1686,7 +1686,7 @@ and not to the directory where the link was present.
|
|||||||
If this option is enabled, deleting files
|
If this option is enabled, deleting files
|
||||||
unintentionally will get more difficult. The default
|
unintentionally will get more difficult. The default
|
||||||
selection in the confirmation dialog changes from the "Yes"
|
selection in the confirmation dialog changes from the "Yes"
|
||||||
to the "No" button and deletion of non empty direcories has to be
|
to the "No" button and deletion of non empty directories has to be
|
||||||
confirmed by entering the word
|
confirmed by entering the word
|
||||||
.I yes
|
.I yes
|
||||||
\&.
|
\&.
|
||||||
@ -1745,7 +1745,7 @@ the access to the files in the file system (for example,
|
|||||||
directory listings fetched from ftp servers).
|
directory listings fetched from ftp servers).
|
||||||
.PP
|
.PP
|
||||||
Moreover in order to access the contents of compressed files
|
Moreover in order to access the contents of compressed files
|
||||||
(for eaxample, compressed tar files) the Midnight Commander
|
(for example, compressed tar files) the Midnight Commander
|
||||||
has to create a temporary uncompressed file on your disk.
|
has to create a temporary uncompressed file on your disk.
|
||||||
.PP
|
.PP
|
||||||
Since both the information in memory and the temporary files on
|
Since both the information in memory and the temporary files on
|
||||||
@ -2011,7 +2011,7 @@ to force the viewer into hex mode;
|
|||||||
.I nroff
|
.I nroff
|
||||||
to tell the viewer that it should interpret the bold and underline
|
to tell the viewer that it should interpret the bold and underline
|
||||||
sequences of nroff;
|
sequences of nroff;
|
||||||
.I unformated
|
.I unformatted
|
||||||
to tell the viewer to not interpret nroff commands for making the text
|
to tell the viewer to not interpret nroff commands for making the text
|
||||||
bold or underlined.
|
bold or underlined.
|
||||||
.PP
|
.PP
|
||||||
@ -2478,8 +2478,8 @@ a C format string. First take a look at the
|
|||||||
and
|
and
|
||||||
.B sprintf man pages to see what a format string
|
.B sprintf man pages to see what a format string
|
||||||
is and how it works. An example is as follows: Suppose you want
|
is and how it works. An example is as follows: Suppose you want
|
||||||
to replace all occurences of say, an open bracket, three
|
to replace all occurrences of say, an open bracket, three
|
||||||
comma seperated numbers, and a close bracket, with the
|
comma separated numbers, and a close bracket, with the
|
||||||
word
|
word
|
||||||
.I apples,
|
.I apples,
|
||||||
the third number, the word
|
the third number, the word
|
||||||
@ -2601,8 +2601,8 @@ machine as that user, otherwise it will use your login name. The
|
|||||||
optional
|
optional
|
||||||
.I pass
|
.I pass
|
||||||
element, if present is the password used for the connection. This use
|
element, if present is the password used for the connection. This use
|
||||||
is not recomented (nor keeping this in your hotlist, unless you set
|
is not recommended (nor keeping this in your hotlist, unless you set
|
||||||
the appropiate permissions there, and then, it may not be entirely
|
the appropriate permissions there, and then, it may not be entirely
|
||||||
safe anyways).
|
safe anyways).
|
||||||
.PP
|
.PP
|
||||||
Examples:
|
Examples:
|
||||||
@ -2935,7 +2935,7 @@ login.
|
|||||||
.I ftpfs_use_passive_connections.
|
.I ftpfs_use_passive_connections.
|
||||||
.IP
|
.IP
|
||||||
This option is by off default. This makes the ftpfs code use the
|
This option is by off default. This makes the ftpfs code use the
|
||||||
passive open mode for transfering files. This is used by people that
|
passive open mode for transferring files. This is used by people that
|
||||||
are behind a filtering packet router. This option just works if you
|
are behind a filtering packet router. This option just works if you
|
||||||
are not using an ftp proxy.
|
are not using an ftp proxy.
|
||||||
.PP
|
.PP
|
||||||
|
@ -5,7 +5,7 @@ mcedit \- Full featured terminal text editor for Unix-like systems.
|
|||||||
.\"SKIP_SECTION"
|
.\"SKIP_SECTION"
|
||||||
.SH USAGE
|
.SH USAGE
|
||||||
.B mcedit
|
.B mcedit
|
||||||
[ file [\-bcCdfhstVx?]]
|
[[+number] file [\-bcCdfhstVx?]]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.LP
|
.LP
|
||||||
Mcedit is a link to
|
Mcedit is a link to
|
||||||
@ -18,6 +18,10 @@ standalone X Window editor.
|
|||||||
.\".\"DONT_SPLIT"
|
.\".\"DONT_SPLIT"
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
|
.I "\+number"
|
||||||
|
Go to the line specified by number (do not insert
|
||||||
|
a space between the "+" sign and the number).
|
||||||
|
.TP
|
||||||
.I "\-b"
|
.I "\-b"
|
||||||
Forces black and white display.
|
Forces black and white display.
|
||||||
.TP
|
.TP
|
||||||
@ -167,7 +171,7 @@ format of the file \fB~/.cedit/syntax\fP.
|
|||||||
|
|
||||||
The file \fB~/.cedit/syntax\fP is rescanned on opening of a any new
|
The file \fB~/.cedit/syntax\fP is rescanned on opening of a any new
|
||||||
editor file. The file contains rules for highlighting, each of which is
|
editor file. The file contains rules for highlighting, each of which is
|
||||||
given on a seperate line, and define which keywords will be highlighted
|
given on a separate line, and define which keywords will be highlighted
|
||||||
to what colour. The file is also divided into sections, each beginning
|
to what colour. The file is also divided into sections, each beginning
|
||||||
with a line with the \fBfile\fP command, followed by a regular
|
with a line with the \fBfile\fP command, followed by a regular
|
||||||
expression. The regular expression dictates the file name that that set
|
expression. The regular expression dictates the file name that that set
|
||||||
@ -244,7 +248,7 @@ command. The \fBwholechars\fP command at the top just sets the
|
|||||||
set exactly to its default and could therefore have been omitted. To
|
set exactly to its default and could therefore have been omitted. To
|
||||||
specify that a word must be whole on the left only, you can use
|
specify that a word must be whole on the left only, you can use
|
||||||
the \fBwholeleft\fP option, and similarly on the right. The left and
|
the \fBwholeleft\fP option, and similarly on the right. The left and
|
||||||
right set of characters can be set seperately with,
|
right set of characters can be set separately with,
|
||||||
.br
|
.br
|
||||||
\fBwholechars\fP [\fBleft\fP|\fBright\fP] \fIcharacters\fP
|
\fBwholechars\fP [\fBleft\fP|\fBright\fP] \fIcharacters\fP
|
||||||
|
|
||||||
@ -260,7 +264,7 @@ Each rule is a line of the form:
|
|||||||
Context or keyword strings are interpreted so that you can include tabs
|
Context or keyword strings are interpreted so that you can include tabs
|
||||||
and spaces with the sequences \\t and \\s. Newlines and the \\ are
|
and spaces with the sequences \\t and \\s. Newlines and the \\ are
|
||||||
specified with \\n and \\\\ respectively. Since whitespace is used as a
|
specified with \\n and \\\\ respectively. Since whitespace is used as a
|
||||||
seperator, it may not be used explicitedly. Also, \\* must be used to
|
separator, it may not be used explicitedly. Also, \\* must be used to
|
||||||
specify a *. The * itself is a wildcard that matches any length of
|
specify a *. The * itself is a wildcard that matches any length of
|
||||||
characters. For example,
|
characters. For example,
|
||||||
.nf
|
.nf
|
||||||
@ -286,7 +290,7 @@ line ends in a \\ thus allowing C preprocessor directive to continue
|
|||||||
across multiple lines.
|
across multiple lines.
|
||||||
|
|
||||||
The colours themselves are numbered 0 to 26 and are explained below in
|
The colours themselves are numbered 0 to 26 and are explained below in
|
||||||
\fBFURTHER BEHAVIOURAL OPTIONS\fP. You can also use \fBany\fP of the named
|
\fBFURTHER BEHAVIORAL OPTIONS\fP. You can also use \fBany\fP of the named
|
||||||
colors specified in \fB/usr/lib/X11/rgb.txt\fP, though only one word
|
colors specified in \fB/usr/lib/X11/rgb.txt\fP, though only one word
|
||||||
versions of them. It is better to stick to the numerical colors
|
versions of them. It is better to stick to the numerical colors
|
||||||
to limit use of the color palette.
|
to limit use of the color palette.
|
||||||
@ -306,7 +310,7 @@ support, because this is flatly impossible.
|
|||||||
|
|
||||||
A useful hint is to work with as much as possible with the things
|
A useful hint is to work with as much as possible with the things
|
||||||
you \fIcan\fP do rather than try to do things that this
|
you \fIcan\fP do rather than try to do things that this
|
||||||
implimentation can't cope with. Also remember that the aim of
|
implementation can't cope with. Also remember that the aim of
|
||||||
syntax highlighting is to make programming less prone to error,
|
syntax highlighting is to make programming less prone to error,
|
||||||
\fInot\fP to make code look pretty.
|
\fInot\fP to make code look pretty.
|
||||||
.PP
|
.PP
|
||||||
@ -326,12 +330,12 @@ editmarked=black,cyan"
|
|||||||
Most options can now be set from the editors options dialog
|
Most options can now be set from the editors options dialog
|
||||||
box. See the \fBOptions\fP menu. The following options are defined in
|
box. See the \fBOptions\fP menu. The following options are defined in
|
||||||
\fB.mc.ini\fP, and have obvious correspondences in the dialog box.
|
\fB.mc.ini\fP, and have obvious correspondences in the dialog box.
|
||||||
You can modifiy them to change the editor behaviour, by editing the file.
|
You can modify them to change the editor behavior, by editing the file.
|
||||||
Unless specified, a 1 sets the option to on, and a 0 sets it to
|
Unless specified, a 1 sets the option to on, and a 0 sets it to
|
||||||
off, as is usual.
|
off, as is usual.
|
||||||
.TP
|
.TP
|
||||||
.I use_internal_edit
|
.I use_internal_edit
|
||||||
This option is ignored when envoking
|
This option is ignored when invoking
|
||||||
.B mcedit.
|
.B mcedit.
|
||||||
.TP
|
.TP
|
||||||
.I editor_key_emulation
|
.I editor_key_emulation
|
||||||
@ -403,8 +407,8 @@ and
|
|||||||
.B sprintf
|
.B sprintf
|
||||||
man pages to see what a format string
|
man pages to see what a format string
|
||||||
is and how it works. An example is as follows: Suppose you want
|
is and how it works. An example is as follows: Suppose you want
|
||||||
to replace all occurances of say, an open bracket, three
|
to replace all occurrences of say, an open bracket, three
|
||||||
comma seperated numbers, and a close bracket, with the
|
comma separated numbers, and a close bracket, with the
|
||||||
word
|
word
|
||||||
.I apples,
|
.I apples,
|
||||||
the third number, the word
|
the third number, the word
|
||||||
|
33
src/main.c
33
src/main.c
@ -328,8 +328,9 @@ char *command_line_colors;
|
|||||||
/* File name to view if argument was supplied */
|
/* File name to view if argument was supplied */
|
||||||
char *view_one_file = 0;
|
char *view_one_file = 0;
|
||||||
|
|
||||||
/* File name to view if argument was supplied */
|
/* File name to edit if argument was supplied */
|
||||||
char *edit_one_file = 0;
|
char *edit_one_file = 0;
|
||||||
|
static int edit_one_file_start_line = 1;
|
||||||
|
|
||||||
/* Used so that widgets know if they are being destroyed or
|
/* Used so that widgets know if they are being destroyed or
|
||||||
shut down */
|
shut down */
|
||||||
@ -1172,7 +1173,7 @@ maybe_cd (int char_code, int move_up_dir)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
set_sort_to (WPanel *p, sortfn *sort_order)
|
set_sort_to (WPanel *p, sortfn *sort_order)
|
||||||
{
|
{
|
||||||
@ -1189,7 +1190,7 @@ set_sort_to (WPanel *p, sortfn *sort_order)
|
|||||||
}
|
}
|
||||||
do_re_sort (p);
|
do_re_sort (p);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
void
|
void
|
||||||
sort_cmd (void)
|
sort_cmd (void)
|
||||||
{
|
{
|
||||||
@ -2212,26 +2213,24 @@ mc_maybe_editor_or_viewer (void)
|
|||||||
setup_dummy_mc (path);
|
setup_dummy_mc (path);
|
||||||
view_file (path, 0, 1);
|
view_file (path, 0, 1);
|
||||||
}
|
}
|
||||||
#ifdef USE_INTERNAL_EDIT
|
|
||||||
else {
|
else {
|
||||||
path = prepend_cwd_on_local ("");
|
path = prepend_cwd_on_local ("");
|
||||||
#ifndef HAVE_GNOME
|
#ifndef HAVE_GNOME
|
||||||
setup_dummy_mc (path);
|
setup_dummy_mc (path);
|
||||||
#endif
|
#endif
|
||||||
edit (edit_one_file, 1);
|
edit (edit_one_file, edit_one_file_start_line);
|
||||||
#ifdef HAVE_GNOME
|
#ifdef HAVE_GNOME
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
exit (1);
|
exit (1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
midnight_shutdown = 1;
|
midnight_shutdown = 1;
|
||||||
done_mc ();
|
done_mc ();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* USE_INTERNAL_EDIT */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_nc (void)
|
do_nc (void)
|
||||||
@ -2870,12 +2869,24 @@ handle_args (int argc, char *argv [])
|
|||||||
base = x_basename (argv[0]);
|
base = x_basename (argv[0]);
|
||||||
if (!STRNCOMP (base, "mce", 3) || !STRCOMP(base, "vi")) {
|
if (!STRNCOMP (base, "mce", 3) || !STRCOMP(base, "vi")) {
|
||||||
edit_one_file = "";
|
edit_one_file = "";
|
||||||
if (tmp)
|
edit_one_file_start_line = 1;
|
||||||
|
if (tmp) {
|
||||||
|
if (*tmp == '+' && isdigit (tmp[1])){
|
||||||
|
int start_line = atoi (tmp);
|
||||||
|
if (start_line > 0) {
|
||||||
|
char *file = poptGetArg (ctx);
|
||||||
|
if (file) {
|
||||||
|
tmp = file;
|
||||||
|
edit_one_file_start_line = start_line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
edit_one_file = g_strdup (tmp);
|
edit_one_file = g_strdup (tmp);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
if (!STRNCOMP (base, "mcv", 3) || !STRCOMP(base, "view")) {
|
if (!STRNCOMP (base, "mcv", 3) || !STRCOMP(base, "view")) {
|
||||||
if (tmp)
|
if (tmp)
|
||||||
view_one_file = g_strdup (tmp);
|
view_one_file = g_strdup (tmp);
|
||||||
} else {
|
} else {
|
||||||
/* sets the current dir and the other dir */
|
/* sets the current dir and the other dir */
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user