Skip to content

Commit

Permalink
Fix ft for repls different then filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
Libor Wagner (home) committed May 7, 2020
1 parent dd35b41 commit b9b1a3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rplugin/python3/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ReplSend(object):
def __init__(self, nvim):
self.nvim = nvim
self.conf = self.nvim.vars['replsend_conf']
self.repl_ft = None
self.repl_channel = None

@neovim.command('Repl', nargs='*', sync=True)
Expand Down Expand Up @@ -36,6 +37,7 @@ def repl(self, args):

# go batch to the current window
self.nvim.command('{}wincmd w'.format(win.number))
self.repl_ft = ft

@neovim.command('ReplSend', nargs='*', range='', sync=False)
def repl_send(self, args, range):
Expand All @@ -47,7 +49,6 @@ def repl_send(self, args, range):
self.nvim.err_write('No repl started\n'.format())
return


# is it a visual selection
visual = False
if 'v' in args:
Expand All @@ -61,7 +62,7 @@ def repl_send(self, args, range):

# get and format text
lines = buf[start:end]
text = self.format(self.conf[ft], lines)
text = self.format(self.conf[self.repl_ft], lines)

# try to send text to channel
try:
Expand Down

0 comments on commit b9b1a3c

Please sign in to comment.