mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
11bc824c4a
override its old contents. Don't use ksh extentions. Treat *.C files as C++. Recognize more C++ extensions. Support java. Update URL for "astyle". Quote all arguments to protect spaces. * lib/edit.spell.rc: Don't save terminal settings - mc does it itself. Quote all arguments to protect spaces.
29 lines
650 B
Bash
29 lines
650 B
Bash
#!/bin/sh
|
|
# *** External Formatter (Indenter) for key F19 cooledit.
|
|
# args:
|
|
# $1 - edit file name
|
|
# $2 - highlight block file name
|
|
# $3 - error file name
|
|
|
|
exec >/dev/null
|
|
exec 2>"$3"
|
|
|
|
case `echo $1 |sed 's/^.*\.//'` in
|
|
c|h)
|
|
# ftp://ftp.gnu.org/pub/gnu/indent/
|
|
indent -kr -pcs "$2"
|
|
;;
|
|
C|cc|CC|cxx|CXX|cpp|CPP)
|
|
# http://astyle.sourceforge.net/
|
|
astyle "$2"
|
|
;;
|
|
java|JAVA)
|
|
# http://astyle.sourceforge.net/
|
|
astyle --style=java --mode=java "$2"
|
|
;;
|
|
*)
|
|
#ftp://alpha.gnu.org/gnu/fetish/textutils-2.0.tar.gz
|
|
fmt "$2" >"$2.tmp" && rm -f "$2" && mv -f "$2.tmp" "$2"
|
|
;;
|
|
esac
|