ciaranm / detectindent

Vim script for automatically detecting indent settings
173 stars 48 forks source link

Optimise dtection by limiting number of lines that is analysed when fail is loaded. #1

Closed suokko closed 15 years ago

suokko commented 15 years ago

attaching patch for fix.

suokko commented 15 years ago

From 64f24f37c0b9530a8eb5ec54bb92436519dff20d Mon Sep 17 00:00:00 2001 From: Pauli Nieminen suokkos@gmail.com Date: Mon, 10 Aug 2009 21:28:57 +0300 Subject: [PATCH] Limit number of lines that are analysed to improve oepning speed if file is very large.

Default number of lines to analyse is 1024. Default can be changed with g:detectindent_max_lines_to_analyse variable.

Signed-off-by: Pauli Nieminen suokkos@gmail.com

doc/detectindent.txt | 4 ++++ plugin/detectindent.vim | 11 +++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/doc/detectindent.txt b/doc/detectindent.txt index 0035cb1..ed7e50b 100644 --- a/doc/detectindent.txt +++ b/doc/detectindent.txt @@ -30,6 +30,10 @@ Author: Ciaran McCreesh :let g:detectindent_preferred_indent = 4 < in your |vimrc| file.

diff --git a/plugin/detectindent.vim b/plugin/detectindent.vim index 0e90f0b..b6bfdd1 100644 --- a/plugin/detectindent.vim +++ b/plugin/detectindent.vim @@ -46,6 +46,10 @@ fun! DetectIndent() let l:has_leading_spaces = 0 let l:shortest_leading_spaces_run = 0 let l:longest_leading_spaces_run = 0

ciaranm commented 15 years ago

Github doesn't seem to like inline patches like that. Could you please fork the repo, apply your change and then send a pull request instead?

suokko commented 15 years ago

yes. I noticed. Seems like git hub is missing major feature that can't make attachments. Maybe there is some tags to make plain text possible in messages but not easy to know it.

Is git send-email ok? (I did send it already to your email contact in github) I can fork and send pull request if you still want it.

ciaranm commented 15 years ago

Yep, that's fine, thanks. I've applied your patch.

Cheers.