Skip to content

Commit

Permalink
background is resonsive to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
timeyyy committed May 24, 2016
1 parent f6a2389 commit 67f53c7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pytknvim/tk_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _tk_quit(self, *args):
self._bridge.exit()


@debug_echo
# @debug_echo
@delay_call(0.1)
def _tk_resize(self, event):
'''Let Neovim know we are changing size'''
Expand Down Expand Up @@ -228,7 +228,7 @@ class MixNvim():

'''These methods get called by neovim'''

@debug_echo
# @debug_echo
def _nvim_resize(self, cols, rows):
'''Let neovim update tkinter when neovim changes size'''
# TODO
Expand Down Expand Up @@ -268,7 +268,7 @@ def _nvim_clear(self):
add_eol=True,)


@debug_echo
# @debug_echo
def _nvim_eol_clear(self):
'''
delete from index to end of line,
Expand All @@ -281,7 +281,7 @@ def _nvim_eol_clear(self):
add_eol=False)


@debug_echo
# @debug_echo
def _nvim_cursor_goto(self, row, col):
'''Move gui cursor to position'''
self._screen.cursor_goto(row, col)
Expand All @@ -308,7 +308,7 @@ def _nvim_mode_change(self, mode):
self._insert_cursor = mode == 'insert'


@debug_echo
# @debug_echo
def _nvim_set_scroll_region(self, top, bot, left, right):
self._screen.set_scroll_region(top, bot, left, right)

Expand Down Expand Up @@ -392,7 +392,7 @@ def _get_tk_attrs(self, attrs):
return rv


@debug_echo
# @debug_echo
def _nvim_put(self, text):
'''
put a charachter into position, we only write the lines
Expand All @@ -417,14 +417,18 @@ def _nvim_visual_bell(self):
pass


@debug_echo
def _nvim_update_fg(self, fg):
self._foreground = fg
self._reset_attrs_cache()


@debug_echo
def _nvim_update_bg(self, bg):
self._background = bg
self._reset_attrs_cache()
background = self._get_tk_attrs(None)[0]['background']
self.text.config(background=background)


def _nvim_update_suspend(self, arg):
Expand All @@ -441,7 +445,6 @@ def _nvim_set_icon(self, icon):
self.root._w, self._icon)


@debug_echo
def _flush(self):
row, startcol, endcol = self._pending
self._pending[0] = self._screen.row
Expand Down Expand Up @@ -471,7 +474,6 @@ def _flush(self):
# print('flush with no draw')


@debug_echo
def _draw(self, row, col, data):
'''
updates a line :)
Expand Down Expand Up @@ -567,6 +569,7 @@ def start(self, bridge):
self._colsize = self._fnormal.measure('M')
self._rowsize = self._fnormal.metrics('linespace')

self.text.config(background='black')
self.root.mainloop()


Expand Down

0 comments on commit 67f53c7

Please sign in to comment.