command_line: fix new line issue when using editor
This commit is contained in:
parent
3a818812a9
commit
6574048763
|
@ -174,12 +174,12 @@ class CommandLine:
|
||||||
except OSError:
|
except OSError:
|
||||||
return
|
return
|
||||||
|
|
||||||
command = ["vi", temp_filepath]
|
command = self.editor_command + [temp_filepath]
|
||||||
open_external_program(command)
|
open_external_program(command)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(temp_filepath, "rt") as temp_file:
|
with open(temp_filepath, "rt") as temp_file:
|
||||||
content = temp_file.read()
|
content = temp_file.read().rstrip("\r\n")
|
||||||
os.unlink(temp_filepath)
|
os.unlink(temp_filepath)
|
||||||
except OSError:
|
except OSError:
|
||||||
return
|
return
|
||||||
|
|
Reference in a new issue