Fix calls to edit_file with wrong editor in conf and note commands.
Also replaces fix from PR #63.
This commit is contained in:
parent
a02f67f133
commit
a600855c31
@ -15,7 +15,7 @@ def command(conf, args):
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
# get modif from user
|
# get modif from user
|
||||||
content.edit_file(conf['main']['edit_cmd'], config.get_confpath())
|
ui.edit_file(config.get_confpath())
|
||||||
|
|
||||||
new_conf = config.load_conf(check=False)
|
new_conf = config.load_conf(check=False)
|
||||||
try:
|
try:
|
||||||
|
@ -20,5 +20,5 @@ def command(conf, args):
|
|||||||
rp = repo.Repository(conf)
|
rp = repo.Repository(conf)
|
||||||
citekey = resolve_citekey(rp, args.citekey, ui=ui, exit_on_fail=True)
|
citekey = resolve_citekey(rp, args.citekey, ui=ui, exit_on_fail=True)
|
||||||
notepath = rp.databroker.real_notepath(citekey)
|
notepath = rp.databroker.real_notepath(citekey)
|
||||||
content.edit_file(conf['main']['edit_cmd'], notepath, temporary=False)
|
ui.edit_file(notepath, temporary=False)
|
||||||
rp.close()
|
rp.close()
|
||||||
|
@ -5,7 +5,7 @@ import sys
|
|||||||
import locale
|
import locale
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
from .content import editor_input
|
from .content import editor_input, edit_file
|
||||||
from . import color
|
from . import color
|
||||||
from . import config
|
from . import config
|
||||||
from .p3 import _get_raw_stdout, _get_raw_stderr, input, ustr
|
from .p3 import _get_raw_stdout, _get_raw_stderr, input, ustr
|
||||||
@ -188,3 +188,6 @@ class InputUI(PrintUI):
|
|||||||
|
|
||||||
def editor_input(self, initial="", suffix='.tmp'):
|
def editor_input(self, initial="", suffix='.tmp'):
|
||||||
return editor_input(self.editor, initial=initial, suffix=suffix)
|
return editor_input(self.editor, initial=initial, suffix=suffix)
|
||||||
|
|
||||||
|
def edit_file(self, path, temporary):
|
||||||
|
edit_file(self.editor, path, temporary=temporary)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user