Skip to content

Commit

Permalink
Fix NeoVintageous#879 RC file options only set on active view at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche authored and eugenesvk committed Jan 6, 2024
1 parent cd5ecec commit 4cf1bd6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nv/rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@ def _load() -> None:
# Note that the import is inline to avoid circular dependency errors.
from NeoVintageous.nv.ex_cmds import do_ex_cmdline
window = sublime.active_window()
window.settings().set('_nv_rc_loading', True)
with builtins.open(_file_path(), 'r', encoding='utf-8', errors='replace') as f:
window.settings().set('_nv_rc_loading', True)
for line in f:
ex_cmdline = _parse_line(line)
if ex_cmdline:
do_ex_cmdline(window, ex_cmdline)

window.settings().erase('_nv_rc_loading')
sublime.save_settings('Preferences.sublime-settings')
window.settings().erase('_nv_rc_loading')
sublime.save_settings('Preferences.sublime-settings')
print('%s file loaded' % _file_name())
except FileNotFoundError:
_log.info('%s file not found', _file_name())
Expand Down

0 comments on commit 4cf1bd6

Please sign in to comment.