1
0
mirror of https://github.com/cheat/cheat.git synced 2025-06-01 04:47:06 +02:00

Addressing issue

Previous pull-requests  and  attempted to resolve . They
were, however, never merged in.

Given that  was just merged (which rewrites a significant amount of
prior code), I here took what we learned from  and  and
re-implemented it. This approach will be less error-prone than
attempting to rebase either of the former on the changes introduced in
 .
This commit is contained in:
Chris Lane 2019-01-18 14:50:00 -05:00
parent 87448c49fa
commit 13c0ea7525
2 changed files with 4 additions and 2 deletions

@ -1,3 +1,4 @@
import io
import os
import shutil
@ -74,5 +75,5 @@ class Sheet:
if not self.exists(sheet):
Utils.die('No cheatsheet found for ' + sheet)
with open(self.path(sheet)) as cheatfile:
with io.open(self.path(sheet), encoding='utf-8') as cheatfile:
return cheatfile.read()

@ -1,3 +1,4 @@
import io
import os
from cheat.utils import Utils
@ -92,7 +93,7 @@ class Sheets:
for cheatsheet in sorted(self.get().items()):
match = ''
for line in open(cheatsheet[1]):
for line in io.open(cheatsheet[1], encoding='utf-8'):
if term in line:
match += ' ' + self._utils.highlight(term, line)