Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve performance of white space removal#137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
klen merged 2 commits intopython-mode:masterfromdjsmith42:master
Oct 22, 2012

Conversation

djsmith42
Copy link

On large'ish python files, this was taking 10+ seconds
at save time. Now it runs instantly, even on very large
python files.

Cursor position does not move.

Dave Smith added2 commitsOctober 13, 2012 20:56
On large'ish python files, this was taking 10+ secondsat save time. Now it runs instantly, even on very largepython files.Cursor position does not move.
@djsmith42djsmith42 mentioned this pull requestOct 15, 2012
klen added a commit that referenced this pull requestOct 22, 2012
Improve performance of white space removal
@klenklen merged commitd6b3a73 intopython-mode:masterOct 22, 2012
@klen
Copy link
Collaborator

Awesome. Thanks

@djsmith42
Copy link
Author

Klen, for some reason, my patch doesn't work all the time. Occasionally, it leaves white space, and I haven't figured out the cause yet. Does it work for you?

@djsmith42
Copy link
Author

Found the cause: The problem appears to manifest when I have multiple split buffers. I'll look into it today.

@djsmith42
Copy link
Author

This patch fixes it, but it won't work for python files without a ".py" extension. I tried using autocmd FileType python autocmd BufWritePre ..., but that didn't work either.

diff --git a/ftplugin/python/pymode.vim b/ftplugin/python/pymode.vimindex ac77f1e..27e847c 100644--- a/ftplugin/python/pymode.vim+++ b/ftplugin/python/pymode.vim@@ -138,7 +138,7 @@ if pymode#Option('utils_whitespaces')         :silent! %s/\s\+$//         call setpos('.', cursor_pos)     endfunction-    au BufWritePre <buffer> call PyModeTrimEndWhiteSpace()+    autocmd BufWritePre *.py :call PyModeTrimEndWhiteSpace() endif

@djsmith42
Copy link
Author

Ah hah. I see you fixed it in9db9857. Nice work!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@djsmith42@klen

[8]ページ先頭

©2009-2025 Movatter.jp