[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kate/part
From:       Johannes Sixt <Johannes.Sixt () telecom ! at>
Date:       2006-03-31 22:43:06
Message-ID: 1143844986.230907.32492.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 525145 by jsixt:

Removed the option "Mixed mode like Emacs".

With the previous modification this is now the only behavior if tabs are
not replaced with spaces; the configuration settings are no longer used.

 M  +1 -5      kateautoindent.cpp  
 M  +0 -1      kateautoindent.h  
 M  +1 -11     katecmds.cpp  
 M  +1 -2      kateconfig.h  
 M  +0 -7      katedialogs.cpp  
 M  +1 -1      katedialogs.h  
 M  +0 -2      katedocument.cpp  
 M  +1 -6      katejscript.cpp  


--- trunk/KDE/kdelibs/kate/part/kateautoindent.cpp #525144:525145
@@ -196,7 +196,6 @@
   KateDocumentConfig *config = doc->config();
 
   useSpaces   = config->configFlags() & KateDocumentConfig::cfReplaceTabsDyn;
-  mixedIndent = useSpaces && config->configFlags() & KateDocumentConfig::cfMixedIndent;
   keepProfile = config->configFlags() & KateDocumentConfig::cfKeepIndentProfile;
   tabWidth    = config->tabWidth();
   indentWidth = config->indentationWidth();
@@ -346,9 +345,6 @@
 
 uint KateNormalIndent::measureIndent (KateDocCursor &cur) const
 {
-  if (useSpaces && !mixedIndent)
-    return cur.column();
-
   return doc->plainKateTextLine(cur.line())->positionWithTabs(cur.column(), tabWidth);
 }
 
@@ -357,7 +353,7 @@
   QString s;
   pos = qMin (pos, (uint)80); // sanity check for large values of pos
 
-  if (!useSpaces || mixedIndent)
+  if (!useSpaces)
   {
     while (pos >= tabWidth)
     {
--- trunk/KDE/kdelibs/kate/part/kateautoindent.h #525144:525145
@@ -328,7 +328,6 @@
   uchar extensionAttrib;
 
   bool  useSpaces;    //!< Should we use spaces or tabs to indent
-  bool  mixedIndent;  //!< Optimize indent by mixing spaces and tabs, ala emacs
   bool  keepProfile;  //!< Always try to honor the leading whitespace of lines already in the file
 };
 
--- trunk/KDE/kdelibs/kate/part/katecmds.cpp #525144:525145
@@ -76,7 +76,7 @@
     << "comment" << "uncomment" << "goto" << "kill-line"
     << "set-tab-width" << "set-replace-tabs" << "set-show-tabs"
     << "set-remove-trailing-space"
-    << "set-indent-width" << "set-mixed-indent"
+    << "set-indent-width"
     << "set-indent-mode" << "set-auto-indent"
     << "set-line-numbers" << "set-folding-markers" << "set-icon-border"
     << "set-word-wrap" << "set-word-wrap-column"
@@ -221,7 +221,6 @@
             cmd == "set-replace-tabs" ||
             cmd == "set-remove-trailing-space" ||
             cmd == "set-show-tabs" ||
-            cmd == "set-mixed-indent" ||
             cmd == "set-word-wrap" ||
             cmd == "set-replace-tabs-save" ||
             cmd == "set-remove-trailing-space-save" ||
@@ -246,15 +245,6 @@
         setDocFlag( KateDocumentConfig::cfRemoveTrailingDyn, enable, v->doc() );
       else if ( cmd == "set-show-tabs" )
         setDocFlag( KateDocumentConfig::cfShowTabs, enable, v->doc() );
-      else if ( cmd == "set-mixed-indent" )
-      {
-        setDocFlag( KateDocumentConfig::cfMixedIndent, enable, v->doc() );
-        if ( enable )
-        {
-          if ( ! v->doc()->config()->indentationWidth() )
-            v->doc()->config()->setIndentationWidth( v->doc()->config()->tabWidth()/2 );
-        }
-      }
       else if ( cmd == "set-word-wrap" )
         v->doc()->setWordWrap( enable );
       else if ( cmd == "set-remove-trailing-space-save" )
--- trunk/KDE/kdelibs/kate/part/kateconfig.h #525144:525145
@@ -176,8 +176,7 @@
       cfTabInsertsTab = 0x1000000,
       cfReplaceTabsDyn=   0x2000000,
       cfRemoveTrailingDyn=0x4000000,
-      cfDoxygenAutoTyping=0x8000000 ,    // Remove for KDE 4.0 (put in indenters)
-      cfMixedIndent = 0x10000000
+      cfDoxygenAutoTyping=0x8000000    // Remove for KDE 4.0 (put in indenters)
     };
 
     uint configFlags () const;
--- trunk/KDE/kdelibs/kate/part/katedialogs.cpp #525144:525145
@@ -130,7 +130,6 @@
     KateDocumentConfig::cfTabIndents,
     KateDocumentConfig::cfBackspaceIndents,
     KateDocumentConfig::cfDoxygenAutoTyping,
-    KateDocumentConfig::cfMixedIndent
 };
 
 KateIndentConfigTab::KateIndentConfigTab(QWidget *parent)
@@ -161,8 +160,6 @@
 
   QGroupBox *gbSpaces = new QGroupBox(i18n("Indentation with Spaces"), this);
   vb = new QVBoxLayout (gbSpaces);
-  opt[5] = new QCheckBox(i18n("Emacs style mixed mode"), gbSpaces);
-  vb->addWidget (opt[5]);
 
   indentationWidth = new KIntNumInput(KateDocumentConfig::global()->indentationWidth(),gbSpaces);
   indentationWidth->setRange(1, 16, 1, false);
@@ -191,7 +188,6 @@
   opt[2]->setChecked(configFlags & flags[2]);
   opt[3]->setChecked(configFlags & flags[3]);
   opt[4]->setChecked(configFlags & flags[4]);
-  opt[5]->setChecked(configFlags & flags[5]);
 
   layout->addWidget(gbAuto);
   layout->addWidget(gbSpaces);
@@ -215,8 +211,6 @@
   opt[4]->setWhatsThis( i18n(
         "Automatically inserts a leading \"*\" while typing within a Doxygen "
         "style comment."));
-  opt[5]->setWhatsThis( i18n(
-      "Use a mix of tab and space characters for indentation.") );
   indentationWidth->setWhatsThis( i18n("The number of spaces to indent with."));
 
   m_configPage->setWhatsThis( i18n(
@@ -242,7 +236,6 @@
   connect( opt[2], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
   connect( opt[3], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
   connect( opt[4], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
-  connect( opt[5], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
 
   connect(indentationWidth, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
 
--- trunk/KDE/kdelibs/kate/part/katedialogs.h #525144:525145
@@ -118,7 +118,7 @@
     void indenterSelected (int);
 
   protected:
-    enum { numFlags = 6 };
+    enum { numFlags = 5 };
     static const int flags[numFlags];
     QCheckBox *opt[numFlags];
     KIntNumInput *indentationWidth;
--- trunk/KDE/kdelibs/kate/part/katedocument.cpp #525144:525145
@@ -4462,8 +4462,6 @@
           m_config->setConfigFlags( KateDocumentConfig::cfRemoveSpaces, state );
         else if ( var == "auto-insert-doxygen" && checkBoolValue( val, &state) )
           m_config->setConfigFlags( KateDocumentConfig::cfDoxygenAutoTyping, state);
-        else if ( var == "mixed-indent" && checkBoolValue( val, &state ) )
-          m_config->setConfigFlags( KateDocumentConfig::cfMixedIndent, state );
 
         // INTEGER SETTINGS
         else if ( var == "tab-width" && checkIntValue( val, &n ) )
--- trunk/KDE/kdelibs/kate/part/katejscript.cpp #525144:525145
@@ -170,7 +170,6 @@
           EditEnd,
           IndentWidth,
           IndentMode,
-          MixedIndent,
           HighlightMode,
           IsInWord,
           CanBreakAt,
@@ -359,13 +358,12 @@
   attribute      KateJSDocument::Attribute        DontDelete|Function 2
 @end
 
-@begin KateJSDocumentTable 4
+@begin KateJSDocumentTable 3
 #
 # Configuration properties
 #
   indentWidth     KateJSDocument::IndentWidth   DontDelete|ReadOnly
   indentMode      KateJSDocument::IndentMode    DontDelete|ReadOnly
-  mixedIndent     KateJSDocument::MixedIndent   DontDelete|ReadOnly
   highlightMode   KateJSDocument::HighlightMode DontDelete|ReadOnly
 @end
 */
@@ -473,9 +471,6 @@
     case KateJSDocument::IndentMode:
       return KJS::String( KateAutoIndent::modeName( doc->config()->indentationMode() ) );
 
-    case KateJSDocument::MixedIndent:
-      return KJS::Boolean( doc->config()->configFlags() & KateDocumentConfig::cfMixedIndent );
-
     case KateJSDocument::HighlightMode:
       return KJS::String( doc->hlModeName( doc->hlMode() ) );
   }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic