Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrogen602 committed Aug 12, 2019
1 parent 4c55099 commit bd1aac9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 69 deletions.
73 changes: 4 additions & 69 deletions femto
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ class TextRenderer(Main):

self.lengthOfFile = 0

self.highlighter = Highlighter()
self.highlighter = HighlighterPython()

self.unsavedContent = False # always false for this class
# altered by edit-enabled subclasses
Expand Down Expand Up @@ -823,6 +823,9 @@ class TextRenderer(Main):

text = text.split('\n')

if self.pathAndFile.endswith('.asm'):
self.highlighter = HighlighterNASM()

if self.inDevelopment:
self.log.write(f'loaded: {pathAndFile}\n')
self.log.write(f'length: {len(text)}\n')
Expand Down Expand Up @@ -879,74 +882,6 @@ class TextRenderer(Main):
self.window.addstr(row, self.marginLeft + counter, filler, curses.color_pair(16))



# def colorPrint(self, text, row, resetX=False, fullLine=False):
# if resetX: # start at the beginning of the line
# prevText = ''
# counter = 0
# else:
# prevText = self.lines[row]
# counter = len(prevText)

# if row == len(self.lines):
# # new line
# self.lines.append('')

# textColorPairs = highlight_python.getColors(text)

# breakNow = False

# for p in textColorPairs:
# txt = p[0]
# color = p[1]

# if counter + len(txt) >= self.width:
# # counter + len(txt) = self.width + 1
# txt = txt[:self.width - counter - 1]
# breakNow = True

# self.window.addstr(row, self.marginLeft + counter, txt, curses.color_pair(color))

# counter += len(txt)

# if breakNow:
# break

# if fullLine:
# filler = ' ' * (self.width - counter - 1)
# self.window.addstr(row, self.marginLeft + counter, filler, curses.color_pair(16))

# if not resetX:
# self.lines[row] = prevText + text



# def print(self, text, row, color=16, resetX=False, fullLine=False):
# raise DeprecationWarning('not updated anymore')

# if resetX: # start at the beginning of the line
# prevText = ''
# col = resetX
# else:
# prevText = self.lines[row]
# col = len(prevText)

# if col + len(text) >= self.width:
# visibleText = text[:self.width - col - 1]
# else:
# visibleText = text

# self.window.addstr(row, col, visibleText, curses.color_pair(color))

# counter = col + len(visibleText)
# if fullLine:
# filler = ' ' * (self.width - counter - 1)
# self.window.addstr(row, counter, filler, curses.color_pair(16))

# if not resetX:
# self.lines[row] = prevText + text


def createPrompt(self, prompt, longAnswer=False):
row = (self.height - len(prompt)) // 2
col = (self.width - len(prompt[0])) // 2
Expand Down
2 changes: 2 additions & 0 deletions hello.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
; nasm -fmacho64 hello.asm && ld hello.o && ./a.out
; ----------------------------------------------------------------------------------------

; test

global start

section .text
Expand Down

0 comments on commit bd1aac9

Please sign in to comment.