2014-02-24 57 views
2

我將我的項目導入到eclipse中,並且它變成了雙倍行距。有誰知道如何解決這一問題?在eclipse中刪除雙倍間距

嘗試:

Find: [\t ]+$ 
Replace With: Nothing //error: incompatible line delimiter 

Find: \s*\n 
Replace With: Nothing //error: incompatible line delimiter 

Find: ^\s*\r?\n 
Replace With: /R //error: incompatible line delimiter 

Find: ^\s*\r?\n 
Replace With: nothing //string not found 

Find: (.)\r\n(.) 
Replace With: nothing //string not found 

File > Convert Line Delimiters to > Windows //no changes 

Source > Apply Formatting //grayed out 

CTRL + Shift + F //doesn't remove double spaces 
+1

爲什麼不在整個項目中使用* Source> Format *函數? – LaurentG

+0

@LaurentG,來源>應用格式是灰色的,我相信這是ctrl + shift + f調用。 –

+0

我想知道爲什麼它首先變成雙間隔。 Eclipse可以將CR + LF作爲行分隔符處理,而不會出現問題。 1.確保項目沒有被打破。 2.該項目的默認行分隔符是什麼?它在項目屬性中。 –

回答

0

project properties我去flexFormatter,改變了選項keep this many blank lines爲0。

0

你嘗試過(與課程的正則表達式檢查):

查找:^ \ S * \ r \ n

替換爲:?\ R

這將找到一條或兩條線並用一條線代替它。

編輯:

有一個相關的帖子,問題的答案,也許一個是適合你:Remove empty lines in eclipse code editor by find/replace (Ctrl+F)

+0

與這一個不兼容的行分隔符 –

+0

@JordanD請參閱編輯正則表達式。這有幫助嗎? – bknopper

+0

我也遇到同樣的錯誤 –