coteditor / cot

Command-line helper tool for CotEditor
https://coteditor.com/cot
Apache License 2.0
55 stars 10 forks source link

cot doesn't open a file. #5

Closed akchan closed 7 years ago

akchan commented 7 years ago

Description

The CLI cot doesn't open a file which is already exists.

Environment and steps to reproduce

mac 10.12.3 (Sierra) python 3.5.1 cot 2.5.0

  1. open terminal.app.
  2. enter commands below.
echo "test file" > test.txt
cot test.txt

Result

Mac just focused to CotEditor but it doesn't open the test.txt file.

Expected result

Mac focused to CotEditor and open the file.

Discussion

In the python script cot, args.files which holds full path to given files is used in some for loops. The function map() returns map object which can be iterated just once. So I propose a solution like below.

1024jp commented 7 years ago

Oh, how stupid, I forgot about this rule in Python 3. Thank you very much!

1024jp commented 7 years ago

I've just released cot 2.5.1 via homebrew so that you can use it until a new CotEditor.app is released.

akchan commented 7 years ago

Thank you for the merging!