2011-06-15 76 views
9

對於我的C++開發,我在Ubuntu上運行納蒂KDevelop的,我有兩個問題:的KDevelop 4.2.2語法高亮問題

1)它強調了我在隨機彩虹色的所有變量 - 我怎樣才能改變這種狀況?我希望我所有的變量都是淺藍色。

2)函數color始終是紫色的,我該如何改變它?

如果有人知道答案,我將不勝感激。

謝謝!

+0

人實際使用KDevelop的,我不知道。這是如何爲你制定的? – Arlen 2011-06-16 01:12:48

+1

我在嘗試了許多其他PHP開發替代方案後正在評估切換到KDevelop。我厭倦了Eclipse,Netbeans和其他所有基於Java的軟件,其速度慢得像地獄一樣複雜,像地球上其他軟件一樣複雜......這非常好。只有showstopper是你不能調試PHP項目... – Palantir 2012-05-19 08:49:11

回答

5

對這兩個問題的答案很簡單:目前你不能。

您可以確保所有變量都以相同的顏色突出顯示,但是這種顏色將會變黑並且無法更改。轉到

設置 - >配置KDevelop的... - >語言支持

,並確保在Semantic Code Highlighting部分都Local Colorization IntensityGlobal Colorization Intensity被設置爲0(即滑塊向左滑動)。

但是,您爲什麼要這樣做?就個人而言,我發現每個變量都有不同的顏色非常方便。它可以讓你很容易地發現特定變量的所有事件。

+0

默認設置給了我一些頭痛:)滑動這些遊標只是一點左,痛苦消失了。感謝分享這個,從來沒有想過... – Palantir 2012-05-19 08:50:54

+0

甚至設置爲0,變量不是黑色的:/很奇怪這樣的功能不能被禁用OO – 2014-10-23 16:24:05

-1

不要擺脫不同顏色的變量,你會問自己如何在沒有它的情況下做過。

+6

爲了將來的參考,只有回答一個問題,如果你真的計劃在回答手頭的問題。如果你想分享你的意見去聊天。 – 2013-01-28 22:21:12

0

是啊...這個源代碼是非常「差」 ......也有不帶選項許多硬編碼值改變他們......幸運的是,它是開源的;)

我跑了出來的同樣的問題:我同意,在某些方面,彩虹色增加可讀性,但就個人而言,它分散了我。所以我沒這個補丁kdevplatform:

diff -aur -x '*.user' -x CMakeFiles kdevplatform-1.7.0-o/language/highlighting/colorcache.cpp kdevplatform-1.7.0-n/language/highlighting/colorcache.cpp 
    --- kdevplatform-1.7.0-o/language/highlighting/colorcache.cpp 2014-08-26 19:49:48.000000000 +0000 
    +++ kdevplatform-1.7.0-n/language/highlighting/colorcache.cpp 2014-10-23 19:50:37.667559094 +0000 
    @@ -43,37 +43,38 @@ 

    #define ifDebug(x) 

    -// ######### start interpolation 
    +//// ######### start interpolation 

    -uint totalColorInterpolationStepCount = 6; 
    -uint interpolationWaypoints[] = {0xff0000, 0xff9900, 0x00ff00, 0x00aaff, 0x0000ff, 0xaa00ff}; 
    -//Do less steps when interpolating to/from green: Green is very dominant, and different mixed green tones are hard to distinguish(and always seem green). 
    -uint interpolationLengths[] = {0xff, 0xff, 0xbb, 0xbb, 0xbb, 0xff}; 
    - 
    -uint totalGeneratedColors = 10; 
    - 
    -uint totalColorInterpolationSteps() 
    -{ 
    - uint ret = 0; 
    - for(uint a = 0; a < totalColorInterpolationStepCount; ++a) 
    - ret += interpolationLengths[a]; 
    - return ret; 
    -} 
    - 
    -///Generates a color from the color wheel. @param step Step-number, one of totalColorInterpolationSteps 
    -QColor interpolate(uint step) 
    -{ 
    - uint waypoint = 0; 
    - while(step > interpolationLengths[waypoint]) { 
    - step -= interpolationLengths[waypoint]; 
    - ++waypoint; 
    - } 
    - 
    - uint nextWaypoint = (waypoint + 1) % totalColorInterpolationStepCount; 
    - 
    - return KColorUtils::mix(QColor(interpolationWaypoints[waypoint]), QColor(interpolationWaypoints[nextWaypoint]), 
    -       float(step)/float(interpolationLengths[waypoint])); 
    -} 
    +//uint totalColorInterpolationStepCount = 6; 
    +//uint interpolationWaypoints[] = {0xff0000, 0xff9900, 0x00ff00, 0x00aaff, 0x0000ff, 0xaa00ff}; 
    +////Do less steps when interpolating to/from green: Green is very dominant, and different mixed green tones are hard to distinguish(and always seem green). 
    +//uint interpolationLengths[] = {0xff, 0xff, 0xbb, 0xbb, 0xbb, 0xff}; 
    + 
    +//uint totalGeneratedColors = 10; 
    + 
    +//uint totalColorInterpolationSteps() 
    +//{ 
    +// uint ret = 0; 
    +// for(uint a = 0; a < totalColorInterpolationStepCount; ++a) 
    +// ret += interpolationLengths[a]; 
    +// return ret; 
    +//} 
    + 
    +/////Generates a color from the color wheel. @param step Step-number, one of totalColorInterpolationSteps 
    + 
    +//QColor interpolate(uint step) 
    +//{ 
    +// uint waypoint = 0; 
    +// while(step > interpolationLengths[waypoint]) { 
    +// step -= interpolationLengths[waypoint]; 
    +// ++waypoint; 
    +// } 
    + 
    +// uint nextWaypoint = (waypoint + 1) % totalColorInterpolationStepCount; 
    + 
    +// return KColorUtils::mix(QColor(interpolationWaypoints[waypoint]), QColor(interpolationWaypoints[nextWaypoint]), 
    +//       float(step)/float(interpolationLengths[waypoint])); 
    +//} 

    // ######### end interpolation 
    namespace KDevelop { 
    @@ -144,6 +145,7 @@ 
    m_defaultColors = new CodeHighlightingColors(this); 

    m_colors.clear(); 
    + /* 
    uint step = totalColorInterpolationSteps()/totalGeneratedColors; 
    uint currentPos = m_colorOffset; 
    ifDebug(kDebug() << "text color:" << m_foregroundColor;) 
    @@ -152,6 +154,7 @@ 
    ifDebug(kDebug() << "color" << a << "interpolated from" << currentPos << " < " << totalColorInterpolationSteps() << ":" << (void*) m_colors.last().rgb();) 
    currentPos += step; 
    } 
    + */ 
    m_validColorCount = m_colors.count(); 
    m_colors.append(m_foregroundColor); 
    } 

它消除產生的顏色,使變量現在真的黑色(前景色)。

2)似乎當前版本尊重凱特語法顏色(不確定)。

上的Archlinux我也做這個PKGBUILD:

pkgname=kdevplatform-no-rainbow-highlight 
    _pkgname=kdevplatform without rainbow colors highlighting 
    pkgver=1.7.0 
    _pkgver=4.7.0 
    pkgrel=2 
    pkgdesc="A C/C++ development platform for KDE" 
    arch=('i686' 'x86_64') 
    url="http://www.kdevelop.org/" 
    license=('GPL') 
    provides=('kdevplatform') 
    conflicts=('kdevplatform') 
    depends=('kdelibs' 'subversion' 'qjson') 
    optdepends=("kdesdk-kompare: difference checking") 
    makedepends=('cmake' 'automoc4' 'boost') 
    install="${_pkgname}.install" 
    source=("http://download.kde.org/stable/kdevelop/${_pkgver}/src/${_pkgname}-${pkgver}.tar.xz" 
     "no-rainbow-color.patch" 
) 
    sha1sums=('9fc196e7cb09ab33fd5cfbf5af19aa7c513efdc9' 
      'bed3c7e470a6a5a56bf1611e0effd7b8a8761e33') 

    prepare() { 
    cd ${_pkgname}-${pkgver} 
    patch -p1 -i ${srcdir}/no-rainbow-color.patch 
    cd ${srcdir} 
    mkdir build 
    } 

    build() { 
    cd build 
    cmake ../${_pkgname}-${pkgver} \ 
    -DCMAKE_INSTALL_PREFIX=/usr \ 
    -DCMAKE_SKIP_RPATH=ON \ 
    -DCMAKE_BUILD_TYPE=Release 
    make 
    } 

    package() { 
    cd build 
    make DESTDIR="${pkgdir}" install 
    }