Merge remote-tracking branch 'lenormf/fix-flake8'

This commit is contained in:
Maxime Coste 2016-09-28 21:47:09 +01:00
commit a66aed21c2

View File

@ -67,15 +67,21 @@ def flake8-diagnostics-next -docstring "Jump to the next line that contains an e
while read line_content; do while read line_content; do
candidate=${line_content%%,*} candidate=${line_content%%,*}
if [ -n "$candidate" ]; then if [ -n "$candidate" ]; then
first_line=$(( first_line == -1 ? candidate : first_line )) if [ $first_line -eq -1 ]; then
line=$((candidate > kak_cursor_line && (candidate < line || line == -1) ? candidate : line )) first_line=$candidate
fi
if [ $candidate -gt $kak_cursor_line ]; then
if [ $candidate -lt $line ] || [ $line -eq -1 ]; then
line=$candidate
fi
fi
fi fi
done done
line=$((line == -1 ? first_line : line)) if [ $line -eq -1 ];
if [ ${line} -ne -1 ]; then line=$first_line
echo "exec ${line} g"
else
echo 'echo -color Error no next flake8 diagnostic' echo 'echo -color Error no next flake8 diagnostic'
else
echo "exec ${line} g"
fi fi
) )
}} }}