New function LeadfFunction! to enter normal mode directly#143
Merged
Yggdroot merged 5 commits intoYggdroot:masterfrom Apr 29, 2018
skywind3000:master
Merged
New function LeadfFunction! to enter normal mode directly#143Yggdroot merged 5 commits intoYggdroot:masterfrom skywind3000:master
Yggdroot merged 5 commits intoYggdroot:masterfrom
skywind3000:master
Conversation
Contributor
skywind3000
commented
Apr 28, 2018
- Postfix a bang sign to LoadfFunction to enable entering normal mode directly
- Reposition cursor to the current function in the function normal mode
… the current function.
Yggdroot
reviewed
Apr 29, 2018
| return | ||
|
|
||
| self._orig_pos = (vim.current.tabpage, vim.current.window, vim.current.buffer) | ||
| self._orig_cursor = (lfEval('line(".")'), lfEval('col(".")')) |
Owner
There was a problem hiding this comment.
这里为啥不用self._orig_cursor = vim.current.window.cursor?
added 2 commits
April 29, 2018 14:42
Yggdroot
reviewed
Apr 29, 2018
| last -= 1 | ||
| if last >= 0: | ||
| index = tags[last][0] | ||
| vim.command(str(index)) |
Owner
There was a problem hiding this comment.
这里最好用lfCmd()来代替vim.command(),lfCmd就是vim.command的alias
Yggdroot
reviewed
Apr 29, 2018
| continue | ||
| filename = text[:pos] | ||
| ln = int(text[pos + 1:]) | ||
| if self._pathEqual(orig_name, filename): |
Owner
There was a problem hiding this comment.
这一句改为if self._pathEqual(lfDecode(orig_name), filename):,那个中文路径的问题就好了。
Yggdroot
reviewed
Apr 29, 2018
| def startExplorer(self, win_pos, *args, **kwargs): | ||
| super(FunctionExplManager, self).startExplorer(win_pos, *args, **kwargs) | ||
| if (not self._launched) or (len(args) > 0): | ||
| return |
Yggdroot
reviewed
Apr 29, 2018
|
|
||
| for _, item in enumerate(output): | ||
| bufname = buffer.name if vim.options["autochdir"] else lfRelpath(buffer.name) | ||
| try: |
2. fixed cjk path name issues in function list
Yggdroot
reviewed
Apr 29, 2018
| if pos < 0: | ||
| continue | ||
| filename = text[:pos] | ||
| ln = int(text[pos + 1:]) |
Owner
There was a problem hiding this comment.
上面这些逻辑,可以用下面两行得到行号:
line = line.rsplit("\t", 1)[1][1:-1] # file:line buf_number
line_nr = line.rsplit(":", 1)[1].split()[0]因为格式是我定的,不存在异常情况。
即:{kind}<tab>{code}<tab>[{file}:{line} {bufnr}]
Contributor
Author
There was a problem hiding this comment.
如果功能正常,就先merge了?至少能跑了,看不惯的地方你一次性全改一遍?
Owner
There was a problem hiding this comment.
这个地方要不然你改一下,我看功能也没什么问题了,以后应该也不会动这一块的代码了。
Contributor
Author
|
已修改。 |
Owner
|
因为提交了很多次,我只能再一次进行squash merge了。 |
Yggdroot
added a commit
that referenced
this pull request
Apr 29, 2018
some enhancements for feature #143
Contributor
Author
|
没事,下次提交我删了再fork。 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.