Skip to content
This repository was archived by the owner on Sep 21, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ensime_shared/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def raw_message(self, message, silent=False):
cmd = 'echo "{}"'.format(message.replace('"', '\\"'))
if silent:
cmd = 'silent ' + cmd
cmd = "let _ensime_showcmd=&showcmd | set noshowcmd | let _ensime_ruler=&ruler | set noruler | " + \
cmd + \
" | let &showcmd=_ensime_showcmd | let &ruler=_ensime_ruler"

if self.isneovim:
vim.async_call(vim.command, cmd)
Expand Down
13 changes: 8 additions & 5 deletions ensime_shared/errors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# coding: utf-8

import os
import re


class InvalidJavaPathError(OSError):
Expand Down Expand Up @@ -31,17 +32,19 @@ def includes(self, path, cursor):
and cursor[1] < self.e

def get_truncated_message(self, cursor, width):
size = len(self.message)
message = re.sub(r"\s\s+|[\r\n]", " ", self.message)
size = len(message)
if size < width:
return self.message
return message
percent = float(cursor[1] - self.c) / (self.e - self.c)
center = int(percent * size)
start = center - width / 2
end = center + width / 2
start = int(center - width / 2)
end = int(center + width / 2)
if start < 0:
start = 0
end = width
elif end > size:
end = size
start = size - width
return self.message[start:end]
return message[start:end]