This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Major fixes, among them windows file handling #44
Open
eyalk11
wants to merge
5
commits into
ipod825:master
Choose a base branch
from
eyalk11:newfixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1091,9 +1091,33 @@ class Netranger(object): | |
1. BufEnter: on_bufenter. create/update NetRangerBuf. | ||
2. CursorMoved: on_cursormoved. update node highlighting and some othe stuff. | ||
""" | ||
def generate_and_ret_buf(self): | ||
bufname = Vim.current.buffer.name | ||
if len(bufname) > 0 and bufname[-1] == '~': | ||
bufname = os.path.expanduser('~') | ||
if not os.path.isdir(bufname): | ||
return | ||
if os.path.islink(bufname): | ||
bufname = os.path.join(os.path.dirname(bufname), | ||
os.readlink(bufname)) | ||
bufname = os.path.abspath(bufname) | ||
|
||
# if self.buf_existed(bufname): | ||
# self._bufs[Vim.current.buffer.number] = self._wd2bufnum[bufname] | ||
# else: | ||
self.gen_new_buf(bufname) | ||
|
||
return self._bufs[Vim.current.buffer.number] | ||
|
||
|
||
|
||
|
||
@property | ||
def cur_buf(self): | ||
return self._bufs[Vim.current.buffer.number] | ||
if Vim.current.buffer.number in self._bufs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you encounter a key not found error here? |
||
return self._bufs[Vim.current.buffer.number] | ||
else: | ||
return self.generate_and_ret_buf() | ||
|
||
@property | ||
def cur_node(self): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate what issues you encountered. We already have a a gen_new_buf function called by on_bufenter, which should guarantee that all call to
cur_buf
to be valid.