Using the "?" pattern in the file selection dialog brought up with '+',
mc uses the file name length in bytes instead of characters.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
* 2309_shell_patterns:
The patch does not intend to fix all Bash patterns (I believe mc never claimed to support all kinds of them), but it fixes some issues. Namely, backslash-escaped metacharacter like {}*? will remain in the pattern (with the current code it is just stripped). Second, comma will be transformed to | only inside a group.
Ticket #2309: "Shell patterns" broken beyond repair.
Namely, backslash-escaped metacharacter like {}*? will remain in the pattern (with the current code it is just stripped). Second, comma will be transformed to | only inside a group.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
How to reproduce:
Either on the command line, or in any other text entry field (e.g. copy
file to) enter a string where the last word consists of one single
letter only. E.g. "abc de f".
Press Alt+Backspace.
Expected behavior: Remove the last word, that is, the letter "f" only,
leaving "abc de ".
Actual behavior: Yet another word is removed, leaving "abc ".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
At certain terminal widths (including the default 80), if the last byte
of a line begins a CJK character then the corresponding glyps is drawn
in the last column, so it's replaced by a replacement symbol.
The default layout should, at all possible terminal widths, have an
extra last character column that is empty normally, but allows room for
a CJK to overflow here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(mcview_handle_editkey): an is_printable() check was performed for every
byte of the UTF-8 which obviously doesn't make sense. This check
shouldn't be performed for 8-bit charsets either. If the given byte can
arrive as input, the file should be modified accordingly.
The TAB key shouldn't be accepted as literal, to allow moving back to
the hexview area.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
UTF-8 characters show up nicely in the right column (followed by a space
to align with the number of bytes).
However, as soon as you edit the file (either by the hex codes, or by
moving to the right column and entering an UTF-8 character), that
character doesn't show up there.
Expected: during editing the file, the right hand side should
continuously be updated to look exactly as if that was the original
contents of the file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
When panel is set to 'Quick view' mode, some keys are handled by
mvciewer, and unhandled keys are passed to the command line. This is
very dangerous since user can easily type and execute a harmful command.
1st step:
* (mcview_callback): don't pass any keys from mcviewer in QuickView
mode to the command line.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Prepend value of system-wide PROMPT_COMMAND variable to the mc's one.
Thanks wjaguar for the idea and Serhiy Storchaka and Oswald Buddenhagen
for the patch itself.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Problem:
Suppose you want to replace a substring in some file names with another,
so you do a File Rename operation with source pattern:
*OLDSTRING*
and target pattern:
\1NEWSTRING\2
If OLDSTRING occurs inside a filename, it is replaced correctly, but if
at the beginning or end of the filename, the corresponding zero-length
wildcard match is replaced by literal \1 or \2, respectively.
Expected
Wildcards that match a zero-length substring should be substituted with
an empty string.
Thanks boris<> for the original patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Support for puppet manifest highlighting was kindly
provided by Sergey Zhuga, original is here:
https://github.com/scrill/puppet-syntax-mcedit
Mr. Zhuga agreed with inclusion in mainstream MC:
https://github.com/scrill/puppet-syntax-mcedit/issues/2
Reasons to favor puppet syntax over pascal for .pp files:
---------------------------------------------------------
I will not argue whether in 2014 pascal is still being used or not,
and to what extent. I would like to point out that whoever is using
any variation of pascal for any serious development, is probably not
using 'mcedit' as an IDE. Instead, this development activity is
probably situated in nice, fully-featured graphical IDE.
Platform wise, judging by the weekly download statistics of FreePascal
at SourceForge, at this moment more than 80% of all downloads are for
Windows environents. On the other hand Midnight Commander is Linux
based. Considering this in combination with speculation from the
previous paragraph, there seems to be only a small chance that 'mcedit'
is being used as an editor of choice for pascal development.
On the contrary, puppet currently certainly does have wider audience
amongst sysadmins, who regularly use Linux. Puppet master requires a
server (usually) and quite a few sysadmins edit files directly on
servers that act as puppet masters for puppet development
environments.
When accessing these servers remotely, mcedit comes very handy for
quick edits here and there. Also keep in mind that puppet files are
normally not very large. Therefore actual IDE would be an overkill and
'mcedit' does the job quite ok, but syntax highlighting would be
much appreciated.
To sum it up:
If we speculate about the *actual* usage of 'mcedit', I do believe that
a wider audience would benefit by having .pp files highlighted by
default with puppet syntax definition instead of pascal syntax
definition.
contrib/Makefile.am: mc.sh and friends should depend on config.status.
In this case contrib/*.?sh are recreated after each rerun of configure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>