This may have something to do with my settings, or is some endemic
problem in
language based indenting.
For my indent settings, I have 'si' set, but not 'ai',
However, in 2 different languages, perl and javascript,
having a backslash in a line will automatically cause indenting on the next
line to be incorrect.
example1: (javascript) with the '\\' audo indent does:
{
{
var halfWidthTLDPattern = '(?:'+TLD.join('|')+')\\b';
var TLDPattern =
---
(indent set to '1' in this script), so it places 2nd line var 2 levels
before where it should be. if I
change the "\\" to "||" (not practical in real life)...
var halfWidthTLDPattern = '(?:'+TLD.join('|')+')||b';
var TLDPattern =
Same thing happens in perl (which is where I noticed it first).
I thought it might be perl-syntax specific, but in editing a javascript
file today, (someone else's, actually), I noticed the same behavior.
So could there be something peculiar in my settings that would cause this?
Why "\"?
"It's pretty consistent" -- *strike that*.. (just testing a few cases)...
going to my perl code... so .. here's a perl example:
sub one {
my $x = sub2 () {
return \$_[0];
} ## wrong haven't finished sub2 yet
my $val;
my $aval=\$val;
my $wrong_indent; # this line was 'de-indented' due to the BckSl.
-or-
sub one {
my $x = sub2 () {
return \\;
} #doubly unhappy!
*
*I tried it in 'vim' as well... same thing. so not 'g' related, and as
it happens on win & unix, not win related.
My 'settings' when I type 'set' (i.e. the non defaults -- had to copy
them from 'vim', since 'gvim' won't let you copy it's output of settings.
(a feature?) (when editing the perl file)
---
autowrite filetype=perl patchmode=.orig smartindent
background=dark foldmethod=marker ruler smarttab
backup helplang=en scroll=19
spelllang=en_us
backupext=.bak history=500 shiftwidth=2 syntax=perl
comments=:# ignorecase showcmd tabstop=2
commentstring=#%s incsearch showmatch ttimeoutlen=50
define=[^A-Za-z_] modified smartcase
backspace=indent,eol,start
backupdir=./.backups,~/.backups,/tmp,C:/tmp
clipboard=autoselect,exclude:cons\|linux,unnamed
cpoptions=aAceFs+*
fileencodings=ucs-bom,utf-8,default,latin1
formatoptions=t2crq
include=\<\(use\|require\)\>
includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
indentexpr=GetPerlIndent()
indentkeys=0{,0},:,0#,!^F,o,O,e,0=,0),0],0=or,0=and
isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=,:
keywordprg=perldoc -f
path=~/bin/lib,~/lib,./lib,/usr/lib/perl5/site_perl/5.12.3/x86_64-linux-thread
-multi,/usr/lib/perl5/site_perl/5.12.3,/usr/lib/perl5/vendor_perl/5.12.3/x86_64-
linux-thread-multi,/usr/lib/perl5/vendor_perl/5.12.3,/usr/lib/perl5/5.12.3/x86_6
4-linux-thread-multi,/usr/lib/perl5/5.12.3,,
wildmode=longest,full
---
The above was when editing the perl test doc. Editing no file:
--
autowrite history=500 shiftwidth=2
spelllang=en_us
background=dark ignorecase showcmd tabstop=2
backup incsearch showmatch ttimeoutlen=50
backupext=.bak patchmode=.orig smartcase
foldmethod=marker ruler smartindent
helplang=en scroll=19 smarttab
backspace=indent,eol,start
backupdir=./.backups,~/.backups,/tmp,C:/tmp
clipboard=autoselect,exclude:cons\|linux,unnamed
cpoptions=aAceFs+*
fileencodings=ucs-bom,utf-8,default,latin1
formatoptions=tcq2
wildmode=longest,full
--
version on my linux says:
7.2 but I don't think it matters, I seem to remember it happening in a 7.3
version as well...
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php