didSelectDisabledFile method

(bool, String?) didSelectDisabledFile(
  1. Msg msg
)

Returns whether a disabled file was selected on this message.

Implementation

(bool, String?) didSelectDisabledFile(Msg msg) {
  if (_files.isEmpty) return (false, null);

  if (msg is! KeyMsg) return (false, null);

  if (!msg.key.matchesSingle(_keyMap.select)) {
    return (false, null);
  }

  final file = _files[_selected];
  final fileName = file.name;

  if (!file.isDirectory && !canSelect(fileName)) {
    return (true, p.join(_currentDirectory, fileName));
  }

  return (false, null);
}