Commit Graph

15696 Commits

Author SHA1 Message Date
Pavel Roskin
44c299c784 Ticket #4446: mcedit: fix off-by-one error in paragraph formatting code.
The default margin is 72 characters, but the editor would keep 73 character
long lines without breaking them.

The visual length of strings was calculated incorrectly. The way "for" loop
was implemented, the byte length would be incremented before exiting the
loop. That would correspond to a character that doesn't fit the line.

Increment the byte length in a separate statement.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-02-20 21:36:37 +03:00
Andrew Borodin
830ecf9780 Merge branch '4370_panelizations'
* 4370_panelizations:
  Ticket #4370: file panelization improvement.
2023-02-19 19:01:25 +03:00
Andrew Borodin
e14ebea59f Ticket #4370: file panelization improvement.
Previously, both file panels share panelization results.
Now each file panel has own panelization buffer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-02-19 19:00:59 +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
Andrew Borodin
cce50e5bff Ticket #4432: wrong sort order after swapping panels.
Revert "(swap_panels): swap panel sort modes too."

This reverts commit d07abec4c3.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-02-01 20:55:28 +03:00
Andrew Borodin
8a91de70c4 Merge branch '4426_cleanup'
* 4426_cleanup: (49 commits)
  ru/mc.1: fix typo.
  doc/NEWS: indentation.
  Update po/*.po files.
  Ticket #4437: (file_frmt_time): fix time format.
  mcedit: use diff syntax highlighting for git commit messages
  (load_extension_file): make one-line long error messages multi-line.
  mc.ext.ini.in: fix a typo (closes MidnightCommander/mc#178).
  Filehighlight: recognize vsix files as zip files (closes MidnightCommander/mc#171).
  mcedit: support modern ECMAScript syntax in TypeScript (closes MidnightCommander/mc#172).
  Aadd syntax highlighting for modern ECMAScript (closes MidnightCommander/mc#172).
  extfs helpers: replace "perl -w" with "use warnings" (closes MidnightCommander/mc#174).
  (do_find): use dir_list_append() to create file list for panelization.
  (do_find): remove unused variable.
  Fix various typos in the source code (closes MidnightCommander/mc#177).
  (panel_destroy): don't free file list.
  (search_content): use g_get_monotonic_time() instead of g_get_real_time().
  (extfs_get_plugins): minor optimization.
  (edit_read_syntax_rules): trivial refactoring.
  mcedit (syntax): minor optimization.
  src/filemanager/panelize.c: use GSList to hold panelize entries.
  ...
2023-01-29 11:25:45 +03:00
Andrew Borodin
8279b4b7e8 ru/mc.1: fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-29 11:24:50 +03:00
Andrew Borodin
cefc35e924 doc/NEWS: indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-29 11:21:23 +03:00
Andrew Borodin
706f7894db Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-29 11:17:20 +03:00
Andrew Borodin
3937f97d96 Ticket #4437: (file_frmt_time): fix time format.
Change minutes and seconds delimiter: h:mm.ss -> h:mm:ss.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +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
Andrew Borodin
08c2d4e276 (load_extension_file): make one-line long error messages multi-line.
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
Robert Yang
6123946251 extfs helpers: replace "perl -w" with "use warnings" (closes MidnightCommander/mc#174).
The shebang's max length is usually 128 as defined in
/usr/include/linux/binfmts.h:
  #define BINPRM_BUF_SIZE 128

To get around this, '/usr/bin/env perl' in place of @PERL@ can be used, but
'/usr/bin/env perl -w' doesn't work:

/usr/bin/env: perl -w: No such file or directory

So replace "perl -w" with "use warnings" to make it work.

The man2hlp.in already has "use warnings;", so just removing '-w' is OK.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-28 21:38:05 +03:00
Andrew Borodin
70599156db (do_find): use dir_list_append() to create file list for panelization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andreas Mohr
606bd02945 (do_find): remove unused variable.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
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
Andrew Borodin
990200f6d3 (panel_destroy): don't free file list.
That is already done in panel_clean_dir().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
0b19bda4a1 (search_content): use g_get_monotonic_time() instead of g_get_real_time().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
58afbbe1ce (extfs_get_plugins): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
7cd8e513dd (edit_read_syntax_rules): trivial refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
dc7dd7ae03 mcedit (syntax): minor optimization.
Use GString for syntax keywords to calculate keyword length at once
when syntax file is being parsed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
a01b391029 src/filemanager/panelize.c: use GSList to hold panelize entries.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
da4212c150 External panelize: rename functions:
external_panelize -> external_panelize_cmd
load_panelize -> external_panelize_load
save_panelize -> external_panelize_save
done_panelize -> external_panelize_free
init_panelize -> external_panelize_init
panelize_done -> external_panelize_done

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
177d1a780c External panelize: refactoring:
*  src/filemanager/panelize.[ch]: keep function related to the external
  panelize command only. Functions related to the panelized mode of file
  panel move to panel.[ch]. Clean up includes.

  * rename functions:
  cd_panelize_cmd -> panel_panelize_cd
  panelize_change_root -> panel_panelize_change_root
  panelize_absolutize_if_needed -> panel_panelize_absolutize_if_needed
  panelize_save_panel -> panel_panelize_save

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
57c61b7681 Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
6e8e55ed05 (vfs_s_open): reuse variable for directory name and file name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
c62d651ee3 Replace variable: global_profile_name -> mc_global_t::profile_name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
b3fb596040 (dlg_init): get rid of extra dialog draws.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
3a3171c990 (widget_default_set_state): clarify set of widget state's exclusive bits.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
fbfb4f565c (menubar_new): do not reset WOP_SELECTABLE options
...because widget is not selectable by default.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
1e9f0d6d69 (buttonbar_new): set options directly.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
6f352854fa tests/mctest.h: indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
fad7029502 lib/vfs/vfs.h: move comment to proper place.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
e7d081565d (edit_read_syntax_file): rename variable and reduce scope.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
52ab57dca0 (sftpfs_read_known_hosts): display the unknown host key type in hex.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
3ad5f5502f Add Ronna (10^27), and Quetta (10^30) SI prefixes.
As voted for in Nov 2022 by the BIPM:
https://www.bipm.org/en/cgpm-2022/resolution-3

Sync with gnulib 0ad3ea4951f77835d02180021589f3a849d885f2.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
6d639ce942 (mc_skin_lines_parse_ini_file): do not overwrite mc_tty_frm array in case of slow and ugly terminal.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
f0a666abac lib/skin/common.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
9f6ef611f4 (ftpfs_setup_passive_epsv): join tests.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
e2521d2187 (do_subshell_chdir): trivial refactoring.
Change tests to place short branches before long ones.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
6a83438163 (vfs_s_retrieve_file): use symbolic name for array size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
2a80ea54dd (widget_init): remove double assignments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
e6cccfbd82 (canonicalize_pathname): make inline.
(canonicalize_pathname_custom): fix description.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin
e42012d51e FISH: refactoring.
* fish_super_t::scr_env: change type to GString.
  * (fish_set_env): return GString, rename variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00