Commit Graph

561 Commits

Author SHA1 Message Date
dsilakov
0d5a989e7e Ticket #4469: add syntax highlighting for Jenkinsfiles.
Jenkinsfiles follow Groovy syntax, treat them accordingly

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-26 20:19:15 +03:00
Pavel Roskin
1ad30a6474 Ticket #4445: skin julia256.ini: minor improvements.
Set "errdhotfocus" to a higher contrast color combination. Yellow is barely
visible on lightgray. The cursor stands on the the focused hotkey. If the
cursor is an underscore, the high contrast is obviously needed. If the focus
is a full box, it normally inverts both the background and the foreground, so
poor contrast remains poor. Red on lightgray is consistent with other colors
of the skin.

Set "menutitle" to yellow on blue. Otherwise, the title is not
distinguishable from the menu entries. Both "parent" skins, default and
xoria256, use distinctive color for the popup menu title.

Set "editrightmargin" to the same color as the panels. White on blue is
extremely distracting in contrast to black background to the left of the
margin.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-02-19 19:00:31 +03:00
Andrew Borodin
be16d3a747 Ticket #4444: mc.ext.ini: .md files are not recognized as Markdown ones by extension.
Change ShellIgnoreCase key to RegexIgnoreCase one since the Regex key
is used.
Simplify Regex value.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-02-17 21:36:28 +03:00
Pavel Roskin
a6fc94f294 Ticket #4441: skin julia256.ini: Fix visual inconsistencies.
Set "disabled" background to "lightgray" for consistency with the dialog
background. The inconsistent background can be seen in the file search dialog
with an empty search string.

The hotkeys in dialogs were impossible to distinguish from other text. Make
them red for consistency with the buttonbar.

Show changed lines in diffs in black on cyan. Blue on cyan is hard to see,
such color combination is not used elsewhere in the skin, which promises
"good contrast".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-02-12 13:37:22 +03:00
JJ Andresson
9ad896f5e7 mcedit: use diff syntax highlighting for git commit messages
...when GIT_EDITOR=mcedit (closes MidnightCommander/mc#85).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Mariusz Białończyk
c84f9b0536 mc.ext.ini.in: fix a typo (closes MidnightCommander/mc#178).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Sorin Sbarnea
93fed656bc Filehighlight: recognize vsix files as zip files (closes MidnightCommander/mc#171).
vsix files are vscode code plugins and they just zip archives, so
it makes sense to recognize them as alternative zip file extension.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
2023-01-28 21:38:05 +03:00
Timur Shemsedinov
4c287bb73e mcedit: support modern ECMAScript syntax in TypeScript (closes MidnightCommander/mc#172).
Signed-off-by: Timur Shemsedinov <timur.shemsedinov@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-28 21:38:05 +03:00
Timur Shemsedinov
1d1c37834a Aadd syntax highlighting for modern ECMAScript (closes MidnightCommander/mc#172).
Signed-off-by: Timur Shemsedinov <timur.shemsedinov@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-28 21:38:05 +03:00
Kian-Meng Ang
5001232704 Fix various typos in the source code (closes MidnightCommander/mc#177).
Found via `codespell -S
po,doc,./misc/syntax,./src/vfs/extfs/helpers/README.it -L
parm,rouge,sav,ect,vie,te,dum,clen,wee,dynamc,childs,ths,fo,nin,unx,nd,iif,iterm,ser,makrs,wil`

Co-authored-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Kian-Meng Ang <kianmeng@cpan.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-28 21:38:05 +03:00
Yury V. Zaytsev
9d7a83aec6 maint: update address protocol and mailing list information 2023-01-02 21:43:20 +01:00
Andrew Borodin
7230269ce4 Ticket #4419: mc.ext.ini: clarify regex for makefiles.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-18 14:44:27 +03:00
Andrew Borodin
cea7d35209 Ticket #4320: syntax/Syntax: document location of syntax files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-18 14:26:30 +03:00
Alexander Fadeev
87bfef7317 Ticket #4412: add TOML (Tom's Obvious Minimal Language) syntax highlighting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-11-26 09:44:24 +03:00
Andrew Borodin
2d7616e3c6 filehighlight.ini: add TypeScript tsx files to sources.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin
d60e3d5311 filehighlight.ini: add Markdown mkd files to documents. 2022-10-10 21:07:40 +03:00
Andrew Borodin
d9eeec9a5a Port mc.ext to INI format.
Ticket #2773: 'include' keyword (for command class def) have no effect
if it was defined before 'Include' keyword (for command def).

Ticket #3742: update comment in mc.ext.ini.

doc: remove mc.ext.ini format description from manual page.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-09-25 14:55:00 +03:00
Pavel Shumskii
971de9651c Ticket #4059: improve YAML multiline blocks syntax highliting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-09 20:10:31 +03:00
Bogdan Pylypenko
08ab71d49b Ticket #4384: mceditor: add syntax file for Privoxy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-03 15:46:22 +03:00
Andrew Borodin
0bb9c04720 Ticket #4377: file type check does not work with special character in filename.
Initial commit: clarify usage of "file" utility.

  * (get_popen_information): compile conditionally depending on USE_FILE_CMD
macro.
  * (get_file_type_local): likewise.
  * (get_file_encoding_local): likewise.
  * (regex_check_type): likewise.
  * (regex_command_for): ignore type method if file utiliti isn't used.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-26 19:57:37 +03:00
Dima Gerasimov
ebbdc8847e Ticket #4369: sqlite 3 view: use 'immutable=1' URI parameter
...to prevent leaving wal/shm files after viewing sqlite database.

The problem I often had with viewing .sqlite files with mc is that
exiting the view mode mid-way may leave .wal/.shm files in the database
directory.

This never caused any actual issues, but a bit annoying, since leftover
.wal files are often a sign that the program working with the database
exited ungracefully.

This effectively reproduces mc's behaviour:

    /tmp/testsqlite $ rm -f *-wal *-shm && sqlite3 "/tmp/testsqlite/db file.sqlite" .dump | head >/dev/null && ls -1 /tmp/testsqlite/
    'db file.sqlite'
    'db file.sqlite-shm'
    'db file.sqlite-wal'

After the change -- no shm/wal files

    /tmp/testsqlite $ rm -f *-wal *-shm && sqlite3 "file:/tmp/testsqlite/db file.sqlite?immutable=1" .dump | head >/dev/null && ls -1 /tmp/testsqlite/
    'db file.sqlite'

You can find the docs on immutable mode here:
https://www.sqlite.org/uri.html#uriimmutable

Immutable mode has been supported in sqlite since 2014:
https://www.sqlite.org/changes.html#version_3_8_5

In case user's sqlite installation is older, the mode is just quietly
ignored, so the change is backwards compatible.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-05-01 09:46:39 +03:00
Andrew Borodin
63e870867e Handle CK_Filter command in the file panel level.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:43:44 +03:00
Zoltan Puskas
9bb705aaba Ticket #4351: file highlighting: add Markdown.
Add markdown into the document highlighting extensions list, since
it's quite popular in many places.

While there are many suggested extensions for the file type[1], this
commit only adds `.md` and `.markdown` as they are the recommended ones
in RFC7763[2] and by the creator themselves[3]. The rest is a hit and
miss anyway, with support highly dependant on the underlying system or
application, and are used infrequently.

[1]https://superuser.com/questions/249436/file-extension-for-markdown-files
[2]https://datatracker.ietf.org/doc/html/rfc7763
[3]https://daringfireball.net/linked/2014/01/08/markdown-extension

Signed-off-by: Zoltan Puskas <zoltan@sinustrom.info>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-19 21:04:58 +03:00
Andrew Borodin
cbcda8a284 file highlighting: add PSD graphical format.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-16 21:23:31 +03:00
Andrew Borodin
e672a0e72d Ticket #4328: file highlighting: add more graphical formats.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-16 16:49:48 +03:00
Alexandros Diamantidis
9bf247805a Ticket #4325: support Shift+Fn keys for KiTTY.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-05 16:01:01 +03:00
Grzegorz Szymaszek
d0cc71e48a Ticket #4322: add basic DOT/Graphviz syntax highlighting.
DOT is a graph description language, described at
<https://graphviz.org/doc/info/lang.html>. The new syntax file
recognizes the basic language keywords and syntax; known node,
edge, graph, etc. properties; comments; character strings.

The syntax file seems to work well with various DOT files found
in the Linux kernel sources as well as with the MNT Reform 2.0D-4
System Diagram.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-20 20:51:43 +03:00
Andrew Borodin
fa0b6f9f93 Ticket #3146: fix typo in skin files: s/scollbar/scrollbar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-18 15:52:33 +03:00
Grzegorz Szymaszek
d5481d2684 Ticket #4319: fix SPICE syntax file to recognize where control script context ends
Since .endc was defined both as the context end delimiter and a context
keyword, it was not recognized as the former and the control script
context, once started, would never be finished. This issue can be
noticed, for example, in wrong syntax highlighting of the .end command
if it was preceded by a control script.

Fix the issue by making the control script context exclusive and
highlighting the .control and .endc keywords in the default context
instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-05 16:31:41 +03:00
Grzegorz Szymaszek
52d9d7946f Ticket #4316: add basic Ngspice syntax highlighting.
Add basic support for highlighting Ngspice/SPICE (http://ngspice.sourceforge.net/)
circuit description files syntax. Two main contexts are defined:
- the default context, where the circuit is described,
- the control script context (between .control and .endc).

The default context highlights dot commands, circuit element instance
names and model types. The control script context highlights supported
functions/commands and known variables. Both contexts highlight comments
and line continuation marks.

Other than two FIXMEs, it is a known issue the first line of the file is
part of the default context, while in most cases it would contain the
file title.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-04 07:13:23 +03:00
Andrew Borodin
a73886ef90 mc.lib: move xterm alt-shift-arrow definitions to lib/tty/key.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin
b6c8f319e9 mc.lib: [terminal:linux] is same as [terminal:console].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
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