PreviousNextTracker indexSee it online !

(182/231) 3607926 - Smarter autoindentation

I have to work with different projects, some do indentation with soft tabs and others use hard tabs. The way autoindentation works now, if the file indentation char isn't the same as in my preferences i get a mix of soft and hard tabs everytime I add or edit a line.

Jedit does a good job by copying the indentation chars in the previous line but fails when adding whitespace based in preference settings. While I guess this is done to preserve existing mixes in soft and hard tabs to the best, I think that's not the most frequent case, normally projects uses one style or the other.

If Jedit got this working well by automatically guessing the indentation style it would be great, I wouldn't need to remind changing preferences when switching projects. If there was a way to select that preference based on directories (or even projects) then it would be a lot better because new files would get the right indentation without manual interaction.

Could this be implemented in Jedit or maybe there's something already available that I don't know about?

Submitted berarma - 2013-03-13 - 20:31:24z Assigned nobody
Priority 5 Category editor core
Status Open Group None
Resolution None Visibility No


2013-03-13 - 23:27:53z
I just found EditorConfig, how did I don't find it before? Yikes.

Anyway, it would be nice that JEdit did not mix tab and spaces but instead used whatever indentation style is being already used in the file. IMHO, using the last whitespace found in the previous line would be more correct most of the time.