# HG changeset patch # User Goffi # Date 1467060875 -7200 # Node ID 4c2f2234b71e0431ef0817b8ad5e2c1a511428c1 # Parent b34fdb44b7d4417bd78d1882215b3943dd7912a9# Parent 0618832a1627eed0e14a6e4f97593fbf8794386d merged modification from souliane diff -r 0618832a1627 -r 4c2f2234b71e frontends/src/jp/cmd_blog.py --- a/frontends/src/jp/cmd_blog.py Sun May 29 11:51:27 2016 +0200 +++ b/frontends/src/jp/cmd_blog.py Mon Jun 27 22:54:35 2016 +0200 @@ -147,7 +147,7 @@ ext = os.path.splitext(path)[1][1:] # we get extension without the '.' if ext: for k,v in SYNTAX_EXT.iteritems(): - if ext == v: + if k and ext == v: return k # if not found, we use current syntax diff -r 0618832a1627 -r 4c2f2234b71e frontends/src/primitivus/primitivus --- a/frontends/src/primitivus/primitivus Sun May 29 11:51:27 2016 +0200 +++ b/frontends/src/primitivus/primitivus Mon Jun 27 22:54:35 2016 +0200 @@ -419,12 +419,19 @@ except AttributeError: log.warning(u"Paste discarded: there is no edit bar yet") else: - # XXX: if a paste is detected, we append it directly to the edit bar text - # so the use can check it and press [enter] if it's OK - buf_paste = u''.join(self.keysToText(input_)) - pos = edit_bar.edit_pos - edit_bar.set_edit_text(u'{}{}{}'.format(edit_bar.edit_text[:pos], buf_paste, edit_bar.edit_text[pos:])) - edit_bar.edit_pos+=len(buf_paste) + if self.main_widget.focus == edit_bar: + # XXX: if a paste is detected, we append it directly to the edit bar text + # so the user can check it and press [enter] if it's OK + buf_paste = u''.join(self.keysToText(input_)) + pos = edit_bar.edit_pos + edit_bar.set_edit_text(u'{}{}{}'.format(edit_bar.edit_text[:pos], buf_paste, edit_bar.edit_text[pos:])) + edit_bar.edit_pos+=len(buf_paste) + else: + # we are not on the edit_bar, + # so we treat pasted text as normal text + if extra is None: + extra = [] + extra.extend(input_) if not extra: return input_ = extra