Commit Graph

529 Commits

Author SHA1 Message Date
Ulya Trofimovich
044cd3d806 Ticket #4298: misc.sh; fix view for files
...on systems that have no /bin/cat (like NixOS).

When opening .diff or .patch files mcview invokes /bin/cat. NixOS has no
/bin/cat (the path to cat looks like /run/current-system/sw/bin/cat).
However cat is still in PATH, so replace /bin/cat with just cat. This
should not affect other systems as /bin should normally be in PATH.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-10-30 19:10:11 +03:00
Andrew Borodin
89d8fa4ac1 Ticket #1: remove SMB suport.
The mc's built-in samba library which is used to access data across
smb links is taken from an old samba version.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-26 10:03:49 +03:00
Michael Stilkerich
4973eb00bb Ticket #4286: mcedit: fix errors in syntax definitions.
Fixed:
  - use of "grey" instead of "gray" (same for "lightgray");
  - use of space in keywords;
  - typos.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-04 18:36:27 +03:00
Andrew Borodin
53b1bb63ac Ticket #4272: nc.ext: fix recognition of plain and compressed man pages.
Support various versions of file utility which output is changed from
one version to another:

$ file --version
file-4.26
magic file from /etc/magic:/usr/share/file/magic
$ file mc.1
mc.1: ASCII troff or preprocessor input text
$ file -z -L mc.1.gz
mc.1.gz: ASCII troff or preprocessor input text (gzip compressed data, was "mc.1", last modified: Tue Aug 24 08:17:47 2021, from Unix)

$ file --version
file-5.40
magic file from /etc/file/magic
eccomp support included
$ file mc.1
mc.1: troff or preprocessor input, ASCII text
$ file -z -L -S mc.1.gz
mc.1.gz: troff or preprocessor input, ASCII text (gzip compressed data, was "mc.1", last modified: Wed Aug 18 04:41:29 2021, from Unix)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-08-29 19:42:10 +03:00
Tomas Szepe
78f8f97fed Ticket #4273: mc.ext reorganization.
Fix mc.ext breakage caused by c3848a689c.

While reorganizing /etc/mc/mc.ext, the order of rules was changed in the file,
causing a bug where more general matches (e. g. any gzipped file) are made
before more specific ones (e. g. a gzip-compressed manpage).

Fix this by reverting to the original order of rules.

Signed-off-by: Tomas Szepe <szepe@pinerecords.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-08-29 17:12:10 +03:00
sdk
fdf2140bc4 Fixup previous commit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-08-07 14:50:39 +03:00
sdk
f533b37bf5 Ticket #4267: support of (alt+)shift+arrow keys in st terminal emulator.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-08-04 21:42:54 +03:00
Andrew Borodin
443a9c897b Ticket #4252: change pattern for OpenRC scripts syntax highlighting.
Use an empty patter (^$) that doesn't match any file name. In this
case, only the shebang is used to detect syntax highlighting rules for
OpenRC scripts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-31 09:07:05 +03:00
TerraTech
3d5fadd2bb Ticket #4246: add syntax highlighting for for openrc-run scripts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 14:21:10 +03:00
Sergii Pylypenko
3409033c28 filehighlight.ini: highlight .json files as documents.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 14:08:29 +03:00
Sergii Pylypenko
4be98a52ba Ticket #4250: mcedit: add syntax highlighting for .json files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 14:05:48 +03:00
Andrew Borodin
ce9eb8f7d1 Ticket #3375: make hardlink highlighted by file type or extension.
filehighlight.ini: move [hardlink] section to the bottom of the file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:54:59 +03:00
Piotrek Żygieło
0e023f0dd9 Ticket #4223: fix recognition of JAR files as ZIP archives
Similar to 7881ed2 that solved ticket #4180.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-28 19:30:11 +03:00
Andrew Borodin
c3848a689c Ticket #4180: reorgzanize mc.ext.
$ file -L image.zip
image.zip: Zip archive data, at least v2.0 to extract
$ file -L -z image.zip
image.zip: JPEG image data, JFIF standard 1.01, resolution (DPI),
density 96x96, segment length 16, baseline, precision 8, 1024x768,
frames 3 (Zip archive data, at least v2.0 to extract)

Since in mc.ext

type/^JPEG

is evaluated before

type/\(Zip archive

mc assume image.zip is a image not an archive.

To solve this, since we use "file -z", match file name at first
(regex/ and shell/), then type/.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-28 15:36:42 +03:00
Purdea Andrei
e50a4d0e25 Ticket# 4215: support syntax highlighting for Verilog/SystemVerilog header files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 08:12:43 +03:00
Andrew Borodin
4ae6cdb774 Ticket #4167: use mediainfo to view info about various media files.
Thanks korrado <anyhow2@mail.ru> for the issue.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-19 16:57:01 +03:00
Andrew Borodin
887bd8fe86 Ticket #4167: clarify e-books support.
mc.ext: add fb2 support.
ext.f/doc.sh.in: change key name for e-books.

Thanks korrado <anyhow2@mail.ru> for the issue.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-19 16:53:11 +03:00
Witold Baryluk
b01fea54a7 Ticket #4140: update python.syntax.
Add nonlocal, async, await keywoards.

nonlocal: added in Python 3.0 in 2006:

https://docs.python.org/3.0/whatsnew/3.0.html
https://www.python.org/dev/peps/pep-3104/
https://docs.python.org/3/reference/simple_stmts.html#the-nonlocal-statement

async, await: added in Python 3.5 in 2015:

https://docs.python.org/3.5/whatsnew/3.5.html#what-s-new-in-python-3-5
https://www.python.org/downloads/release/python-350/
https://www.python.org/dev/peps/pep-0492/
https://docs.python.org/3/reference/compound_stmts.html#async-def
https://docs.python.org/3/reference/compound_stmts.html#the-async-for-statement
https://docs.python.org/3/reference/compound_stmts.html#the-async-with-statement
https://docs.python.org/3/reference/expressions.html#await-expression
https://docs.python.org/3/glossary.html#term-coroutine
https://docs.python.org/3/library/asyncio-task.html
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-19 16:26:46 +03:00
Marek Černocký
c8649068d3 Ticket #4194: add .c++ and .h++ extensions for highlight.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-18 16:52:21 +03:00
Andrew Borodin
7881ed2fda Ticket #4180: fix handling of zip archives.
After 8857423e4e due to
using "file -z", zip archves w/o ".zip" file name extension
(i.e. "ff_ext.xpi", a Firefox extension) aren't handled
as zip archives.

misc/mc.ext.in: fix regular expression for zip format.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-23 21:10:04 +03:00
Andrew Borodin
1869dffd14 Ticket #4103: code cleanup before 4.8.26 release.
Initial step: rename keymap sections:
  main -> filemanager
  main:xmap -> filemanager:xmap

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Marco Ciampa
18a300e64f Fixed reference to Yabasic sintax file 2020-12-28 11:58:15 +01:00
Milan Voves
e6315c1c75 Swift syntax
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-24 16:34:43 +03:00
Dmitry Solomennikov
f815e3593f Ticket #4158: make modarcon16 skin consistent with whitespaces.
Whitespaces (i.e. tabs and trailing spaces) are not consistent with
other parts of skin, they're bright on blue. Makes them green on black
background.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-20 17:55:09 +03:00
Andrew Borodin
662754c6f8 Filehighlight fodg, fodp, fods, fodt, odg as documents.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-20 17:48:49 +03:00
RALOVICH, Kristof
9db7573de9 Ticket #4157: add support for OpenDocument flax xml formats.
Support fodt, fods, fodp, fodg files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-20 17:44:54 +03:00
Sergei Trofimovich
bad1523378 Ticket #4149: add 'alacritty', 'tmux', 'tmux-256color' as xterm aliases
'alacritty', 'tmux' and 'tmux-256color' all implement Shift+F<N> keys
in an xterm-compatible way. Without this change Shift+F<N> are handled
as F<N-2> key presses.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-13 20:18:48 +03:00
Ilia Maslakov
954e83191c Ticket #4130: add PAK archive support for extfs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-08 17:36:36 +03:00
Vadim Kalinnikov
942c5549c9 Ticket #4100: extfs vfs: support of WIM archive (image).
wimtools (https://wimlib.net/) are required.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-29 16:58:36 +03:00
Oswald Buddenhagen
8857423e4e Ticket #4128: improve handling of compressed content in mc.ext.
call 'file' with -z switch to enable getting the type of compressed files,
and use that capability extensively.

the /logs?/ hacks in ext.d/text.sh need to remain for the time being, as
file -z doesn't handle .lz4 files as encapsulated content.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:36:09 +03:00
Oswald Buddenhagen
f2cbaf19e5 Relax mc.ext matching rules for makefiles.
match the special cases first, and match makefiles irrespective of
extension. that is useful, as hand-written make-based build systems
often use qualifying suffixes, like .unix.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-10 15:56:05 +03:00
Oswald Buddenhagen
335c4eeec6 Replace xmms with audacious in ext.d/shound.sh.
xmms hasn't been maintained for ages. audacious is a maintained fork of
it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-10 15:55:56 +03:00
Oswald Buddenhagen
31e7a7e963 Ticket #4127: several improvements to mc.ext and syntax highlighting.
add plenty of missing 'which' commands in ext.d.

the construct 'if <command>' to check the presence of a command would
work in some cases (though inefficiently), but it others it was just
bogus. in every case it was inconsistent and confusing.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-10 15:55:42 +03:00
Andrew Borodin
e1c892a49f Ticket #4107: bind ctrl-i to the ChangePanel action.
After ef5f1fa3eb ctrl-i stopped working
on some terminals including native Linux console.

To fix this, add default binging ctrl-i shortcut to ChangePanel action.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-15 11:45:46 +03:00
Andrew Borodin
8b4386df83 Ticket #4120: draw shadows for dialog boxes and menus.
Thanks Aleš Janda <ales.janda@kyblsoft.cz> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-02 16:13:26 +03:00
Purdea Andrei
1f4b5ae396 Ticket #4098: syntax highlighting: support .ino files.
Add the .ino extension to the list of extensions recognized by the c++
syntax highlighter.

.ino is used by the Arduino IDE, and a number of other IDEs, and it's effectively
the same thing as a c++ source file, but with some added magic, such as auto-generated
function prototypes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-21 19:58:56 +03:00
Artem S. Tashkinov
9bb351508a Ticket #4045: clean up in video.sh handler.
RealPlayer is a proprietary application which can't be installed in most
distros and has long been abandoned.

gtv hasn't been developed since 2003.

xanim barely plays anything.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 20:45:28 +03:00
Vadim Kalinnikov
40fe047be0 Ticket #4086: improve archive support.
Support more binaries to view archive content:
  * lha: jlha, lhasa
  * arj: 7za
  * cab: 7za
  * zip; 7z
  * zipx: 7za
  * iso: 7za

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 20:31:45 +03:00
Andrew Borodin
9311136158 Ticket #4054: broken syntax highlighting for shell scripts.
Revert "Ticket #3981: sh.syntax: allow for indented 'function' highlighting."

This reverts commit 91d6d55baf.

The syntax highlighting of shell scripts in mcedit misbehaves around
matches of "function blabla()" inside literal quotes. It applies syntax
highlighting as if it was function definition in normal conditions (out
of literal quotes), breaking the colouring of whatever follows.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 20:13:37 +03:00
Andrey Brozhko
91e4d8150f Ticket #4088: mcedit: add Kotlin syntax highlighting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 20:06:04 +03:00
Purdea Andrei
f32614ae7f verilog syntax: clarify that also refers to systemverilog,
...and make sure it also takes .sv files as well.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:44:02 +03:00
Purdea Andrei
06f2c6093e verilog syntax: added some missing operators
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:42:10 +03:00
Purdea Andrei
281ba2a35e verilog syntax: reorganized and added missing compiler directives
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:42:02 +03:00
Purdea Andrei
81122ffcae verilog syntax: reorganized and added missing system tasks and system functions
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:41:50 +03:00
Purdea Andrei
32878bdd3d verilog syntax: added IEEE1800-2009 and 2012 missing keywords
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:41:19 +03:00
Purdea Andrei
6351c4bc49 verilog syntax: added IEEE1800-2005 missing keywords
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:41:12 +03:00
Purdea Andrei
0cdb39d76f verilog syntax: added IEEE1364-2005 missing keywords
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:40:56 +03:00
Purdea Andrei
b0927b0627 verilog syntax: added IEEE1364-2001 missing keywords
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:40:47 +03:00
Purdea Andrei
91fdf29635 verilog syntax: added missing ieee1364-1995 keywords
...and moved ieee1364-2001 keyword in separate section.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:40:25 +03:00
Purdea Andrei
2df64d7b9c Ticket #4087: verilog syntax: removing keyboards attribute, endattribute, strength
Keywords attribute, endattribute, strength are not a reserved keywords in any
verilog standard. I can find a few references to these saying that they
were reserved keywords in OVI LRM version 2.0 (a version of verilog
before it was standardized), but this LRM is not available. The OVI LRM
version 1.0 didn't include these keywords, and none of the IEEE standards
include these keywords. I also tried the syntax highlighter of two
commercial tools, and they don't show attribute/endattribute as keywords.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-06 19:38:46 +03:00