Commit Graph

15227 Commits

Author SHA1 Message Date
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 eff779b246 Merge branch '4270_cleanup'
* 4270_cleanup: (33 commits)
  Upate po/*.po files.
  mc.lib: move xterm alt-shift-arrow definitions to lib/tty/key.c.
  mc.lib: [terminal:linux] is same as [terminal:console].
  (delete_region, copy_region): rename arguments.
  src/editor/editwidget.c: grammar.
  mceditor: use MB_LEN_MAX constant.
  (string_file_name): use mc_g_string_copy.
  (complete_engine, insert_text): don't calculate text length twice.
  lib/strutil/strutilutf8.c: use MB_LEN_MAX constant.
  Remove get_process_stats() test.
  Use g_get_monotonic_time() instead of g_get_real_time().
  (learn_key): return NULL if buffer is empty.
  (learn_key): use g_get_real_time () to simplify time comparision.
  (get_key_code): use g_get_real_time () to simplify time comparision.
  (xmouse_get_event): use g_get_real_time () to simplify time comparision.
  lib/tty/key.c: use named constants for time intervals.
  (file_mask_dialog): indentation.
  Reimplement compiler options checking.
  lib/util.c: remove unneeded include.
  lib/keybind.h: remove unneeded includes.
  ...
2021-11-21 15:19:38 +03:00
Andrew Borodin 9707afc084 Upate po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:19:19 +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
Andrew Borodin 9149a6d132 (delete_region, copy_region): rename arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 529c7d70dd src/editor/editwidget.c: grammar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 19591c4475 mceditor: use MB_LEN_MAX constant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin a147082c73 (string_file_name): use mc_g_string_copy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 8010b08584 (complete_engine, insert_text): don't calculate text length twice.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin e71972003e lib/strutil/strutilutf8.c: use MB_LEN_MAX constant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin ccbac47385 Remove get_process_stats() test.
The GLib API is used for measurement of time intervals.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 4e8b00f003 Use g_get_monotonic_time() instead of g_get_real_time().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 31008bcc8e (learn_key): return NULL if buffer is empty.
(learn_button): simplify tests: seq is never empty here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 0e09fc3088 (learn_key): use g_get_real_time () to simplify time comparision.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 254a311cc0 (get_key_code): use g_get_real_time () to simplify time comparision.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 8885987f1d (xmouse_get_event): use g_get_real_time () to simplify time comparision.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 40675220c1 lib/tty/key.c: use named constants for time intervals.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin a4adc09509 (file_mask_dialog): indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 62d2580302 Reimplement compiler options checking. 2021-11-21 15:00:39 +03:00
Andrew Borodin c32c4b316b lib/util.c: remove unneeded include.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 93a4ecc11e lib/keybind.h: remove unneeded includes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin eefc7c1275 (copy_file_file_display_progress): rename argument to make it clearer.
(copy_file_file): rename variable to make it clearer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin e8e3204e61 (copy_file_file): don't call g_get_real_time() twice...
in case of successful copying of file content.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin bb1ab8488b (copy_file_file_display_progress): don't calculate BPS twice.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 78df2f5b56 (progress_update_one): don't call g_get_real_time() twice at first time.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 437211791f file operations: use g_get_real_time() instead of gettimeofday().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin d04abc5a76 sftpfs: refactoring.
Merge init.c, vfs_class.c, and vfs_subclass.c to sftpfs.c.
Rename files:
    init.h -> sftpfs.h.
Rename variables:
    sftpfs_class -> vfs_sftpfs_class.
Rename functions:
    sftpfs_cb_is_equal_connection -> sftpfs_archive_same
    sftpfs_cb_init_connection -> sftpfs_new_archive
    sftpfs_cb_open_connection -> sftpfs_open_archive
    sftpfs_cb_close_connection ->  sftpfs_free_archive
to be consistent with other VFSes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 4fce4fa7c3 sftpfs: trivial optimization.
* (sftpfs_opendir): call sftpfs_fix_filename() before loop.
  * (sftpfs_mkdir): likewise.
  * (sftpfs_rmdir): likewise.
  * (sftpfs_open_file): likewise.
  * (sftpfs_stat_init): likewise.
  * (sftpfs_readlink): likewise.
  * (sftpfs_utime): likewise.
  * (sftpfs_chmod): likewise.
  * (sftpfs_unlink): likewise.
  * (sftpfs_rename): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 6623a9014f (panel_operate): update panel content before screen refresh.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:33 +03:00
Andrew Borodin 022c3d2f94 Refactoring of file operations.
(copy_cmd, copy_cmd_local, rename_cmd, rename_cmd_local, delete_cmd,
delete_cmd_local): move same code to panel_operate(), make inline.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andrew Borodin d410af27c0 (start_search): ret rid of extra screen redraw.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andrew Borodin cac689a81a Get rid of extra update of mini info.
(stop_search): don't update mini info if quick search is incative.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andrew Borodin d19b247c6d Ticket #4384: fix accelerator conflict in Left/Right menu.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andy Alt b71b7ea9d3 Ticket #4270: code clean up before 4.8.28 release.
MidnightCommander/#165: doc/README: grammar.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andrew Borodin b8262f22e8 Merge branch '3887_endianness'
* 3887_endianness:
  Ticket #3887: (handle_console_linux): fix endianness bug.
2021-11-21 14:50:39 +03:00
Andrew Borodin a3d323c6b3 Ticket #3887: (handle_console_linux): fix endianness bug.
handle_console_linux() passes the address of action to write() and intends
to send one byte of data (the LSB). On LE this works, but one BE machines
this sends the MSB which is always zero. Fix this by assigning the value
first to a char type, and use that instead.

Thanks Sven Schnelle <svens@stackframe.org> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:49:46 +03:00
Andrew Borodin 53143b08a0 Merge branch '4150_mcview_MC_EXT_BASENAME'
* 4150_mcview_MC_EXT_BASENAME:
  Ticket #4150: support file/dir macros for standalone mcviewer.
2021-11-14 19:59:50 +03:00
Andrew Borodin f1e2f0e93d Ticket #4150: support file/dir macros for standalone mcviewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-10-31 09:49:45 +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 8b79bfe32d (free_erase_list): test queue before free.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-10-02 11:41:07 +03:00
Marco Ciampa 7871db5258 Added autogenerated mc-version.h to the list of git-ignored files 2021-09-29 09:49:03 +02:00
Marco Ciampa f5bcd63921 Updated Italian translation 2021-09-29 09:45:30 +02:00
Andrew Borodin 6f676d0667 Merge branch '1_smbfs_remove'
* 1_smbfs_remove:
  Update po/*.po files.
  Ticket #1: remove SMB suport.
2021-09-26 10:09:15 +03:00
Andrew Borodin 037c14d339 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-26 10:07:40 +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
Andrew Borodin 30fbbe75b8 Merge branch '4285_sftp_symlink_timestamps'
* 4285_sftp_symlink_timestamps:
  (sftpfs_chmod): set permissions only, don't touch other attributes.
  Ticket #4285: sftp: timestamps are not preserved for uploaded symlink.
2021-09-26 09:57:39 +03:00