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
|
||||
backquotes on bash won't accept your suspension the program with
|
||||
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
|
||||
.I "\-s"
|
||||
Turns on the slow terminal mode, in this mode the program will not
|
||||
@ -1461,7 +1461,7 @@ with '#', space or tab.
|
||||
.PP
|
||||
.SH " Options Menu"
|
||||
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.
|
||||
.PP
|
||||
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)
|
||||
the selection bar will move down.
|
||||
.PP
|
||||
.I Drop down menues.
|
||||
.I Drop down menus.
|
||||
When this option is enabled, when you press the
|
||||
.B F9
|
||||
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
|
||||
unintentionally will get more difficult. The default
|
||||
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
|
||||
.I yes
|
||||
\&.
|
||||
@ -1745,7 +1745,7 @@ the access to the files in the file system (for example,
|
||||
directory listings fetched from ftp servers).
|
||||
.PP
|
||||
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.
|
||||
.PP
|
||||
Since both the information in memory and the temporary files on
|
||||
@ -2011,7 +2011,7 @@ to force the viewer into hex mode;
|
||||
.I nroff
|
||||
to tell the viewer that it should interpret the bold and underline
|
||||
sequences of nroff;
|
||||
.I unformated
|
||||
.I unformatted
|
||||
to tell the viewer to not interpret nroff commands for making the text
|
||||
bold or underlined.
|
||||
.PP
|
||||
@ -2478,8 +2478,8 @@ a C format string. First take a look at the
|
||||
and
|
||||
.B sprintf man pages to see what a format string
|
||||
is and how it works. An example is as follows: Suppose you want
|
||||
to replace all occurences of say, an open bracket, three
|
||||
comma seperated numbers, and a close bracket, with the
|
||||
to replace all occurrences of say, an open bracket, three
|
||||
comma separated numbers, and a close bracket, with the
|
||||
word
|
||||
.I apples,
|
||||
the third number, the word
|
||||
@ -2601,8 +2601,8 @@ machine as that user, otherwise it will use your login name. The
|
||||
optional
|
||||
.I pass
|
||||
element, if present is the password used for the connection. This use
|
||||
is not recomented (nor keeping this in your hotlist, unless you set
|
||||
the appropiate permissions there, and then, it may not be entirely
|
||||
is not recommended (nor keeping this in your hotlist, unless you set
|
||||
the appropriate permissions there, and then, it may not be entirely
|
||||
safe anyways).
|
||||
.PP
|
||||
Examples:
|
||||
@ -2935,7 +2935,7 @@ login.
|
||||
.I ftpfs_use_passive_connections.
|
||||
.IP
|
||||
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 not using an ftp proxy.
|
||||
.PP
|
||||
|
@ -5,7 +5,7 @@ mcedit \- Full featured terminal text editor for Unix-like systems.
|
||||
.\"SKIP_SECTION"
|
||||
.SH USAGE
|
||||
.B mcedit
|
||||
[ file [\-bcCdfhstVx?]]
|
||||
[[+number] file [\-bcCdfhstVx?]]
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
Mcedit is a link to
|
||||
@ -18,6 +18,10 @@ standalone X Window editor.
|
||||
.\".\"DONT_SPLIT"
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I "\+number"
|
||||
Go to the line specified by number (do not insert
|
||||
a space between the "+" sign and the number).
|
||||
.TP
|
||||
.I "\-b"
|
||||
Forces black and white display.
|
||||
.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
|
||||
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
|
||||
with a line with the \fBfile\fP command, followed by a regular
|
||||
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
|
||||
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
|
||||
right set of characters can be set seperately with,
|
||||
right set of characters can be set separately with,
|
||||
.br
|
||||
\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
|
||||
and spaces with the sequences \\t and \\s. Newlines and the \\ are
|
||||
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
|
||||
characters. For example,
|
||||
.nf
|
||||
@ -286,7 +290,7 @@ line ends in a \\ thus allowing C preprocessor directive to continue
|
||||
across multiple lines.
|
||||
|
||||
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
|
||||
versions of them. It is better to stick to the numerical colors
|
||||
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
|
||||
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,
|
||||
\fInot\fP to make code look pretty.
|
||||
.PP
|
||||
@ -326,12 +330,12 @@ editmarked=black,cyan"
|
||||
Most options can now be set from the editors options dialog
|
||||
box. See the \fBOptions\fP menu. The following options are defined in
|
||||
\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
|
||||
off, as is usual.
|
||||
.TP
|
||||
.I use_internal_edit
|
||||
This option is ignored when envoking
|
||||
This option is ignored when invoking
|
||||
.B mcedit.
|
||||
.TP
|
||||
.I editor_key_emulation
|
||||
@ -403,8 +407,8 @@ and
|
||||
.B sprintf
|
||||
man pages to see what a format string
|
||||
is and how it works. An example is as follows: Suppose you want
|
||||
to replace all occurances of say, an open bracket, three
|
||||
comma seperated numbers, and a close bracket, with the
|
||||
to replace all occurrences of say, an open bracket, three
|
||||
comma separated numbers, and a close bracket, with the
|
||||
word
|
||||
.I apples,
|
||||
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 */
|
||||
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;
|
||||
static int edit_one_file_start_line = 1;
|
||||
|
||||
/* Used so that widgets know if they are being destroyed or
|
||||
shut down */
|
||||
@ -1172,7 +1173,7 @@ maybe_cd (int char_code, int move_up_dir)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
set_sort_to (WPanel *p, sortfn *sort_order)
|
||||
{
|
||||
@ -1189,7 +1190,7 @@ set_sort_to (WPanel *p, sortfn *sort_order)
|
||||
}
|
||||
do_re_sort (p);
|
||||
}
|
||||
|
||||
#endif
|
||||
void
|
||||
sort_cmd (void)
|
||||
{
|
||||
@ -2212,26 +2213,24 @@ mc_maybe_editor_or_viewer (void)
|
||||
setup_dummy_mc (path);
|
||||
view_file (path, 0, 1);
|
||||
}
|
||||
#ifdef USE_INTERNAL_EDIT
|
||||
else {
|
||||
path = prepend_cwd_on_local ("");
|
||||
#ifndef HAVE_GNOME
|
||||
setup_dummy_mc (path);
|
||||
#endif
|
||||
edit (edit_one_file, 1);
|
||||
edit (edit_one_file, edit_one_file_start_line);
|
||||
#ifdef HAVE_GNOME
|
||||
gtk_main ();
|
||||
exit (1);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
g_free (path);
|
||||
midnight_shutdown = 1;
|
||||
done_mc ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* USE_INTERNAL_EDIT */
|
||||
|
||||
static void
|
||||
do_nc (void)
|
||||
@ -2870,12 +2869,24 @@ handle_args (int argc, char *argv [])
|
||||
base = x_basename (argv[0]);
|
||||
if (!STRNCOMP (base, "mce", 3) || !STRCOMP(base, "vi")) {
|
||||
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);
|
||||
}
|
||||
} else
|
||||
if (!STRNCOMP (base, "mcv", 3) || !STRCOMP(base, "view")) {
|
||||
if (tmp)
|
||||
view_one_file = g_strdup (tmp);
|
||||
if (!STRNCOMP (base, "mcv", 3) || !STRCOMP(base, "view")) {
|
||||
if (tmp)
|
||||
view_one_file = g_strdup (tmp);
|
||||
} else {
|
||||
/* sets the current dir and the other dir */
|
||||
if (tmp) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user