@@ -116,7 +116,7 @@ class PreferencesViewController: NSViewController {
116116
117117 @IBOutlet weak var wordWrapPopup : NSPopUpButton !
118118 @IBOutlet weak var lineLengthTextField : NSTextField !
119- @IBOutlet weak var lineLenghLabel : NSTextField !
119+ @IBOutlet weak var lineLengthLabel : NSTextField !
120120 @IBOutlet weak var lineNumbersPopup : NSPopUpButton !
121121 @IBOutlet weak var tabSpacesSlider : NSSlider !
122122 @IBOutlet weak var argumentsTextField : NSTextField !
@@ -148,22 +148,22 @@ class PreferencesViewController: NSViewController {
148148 @IBOutlet weak var utiCustomCSSButton : NSButton !
149149 @IBOutlet weak var utiCustomCSSImage : NSImageView !
150150
151- @IBOutlet weak var utiFontChecbox : NSButton !
151+ @IBOutlet weak var utiFontCheckbox : NSButton !
152152 @IBOutlet weak var utiFontPreviewTextField : NSTextField !
153153 @IBOutlet weak var utiFontChooseButton : NSButton !
154154
155- @IBOutlet weak var utiWordWrapChecbox : NSButton !
155+ @IBOutlet weak var utiWordWrapCheckbox : NSButton !
156156 @IBOutlet weak var utiWordWrapPopup : NSPopUpButton !
157157 @IBOutlet weak var utiLineLengthTextField : NSTextField !
158- @IBOutlet weak var utiLineLenghLabel : NSTextField !
158+ @IBOutlet weak var utiLineLengthLabel : NSTextField !
159159
160- @IBOutlet weak var utiLineNumberChecbox : NSButton !
160+ @IBOutlet weak var utiLineNumberCheckbox : NSButton !
161161 @IBOutlet weak var utiLineNumbersPopup : NSPopUpButton !
162162
163- @IBOutlet weak var utiTabSpacesChecbox : NSButton !
163+ @IBOutlet weak var utiTabSpacesCheckbox : NSButton !
164164 @IBOutlet weak var utiTabSpacesSlider : NSSlider !
165165
166- @IBOutlet weak var utiArgumentsChecbox : NSButton !
166+ @IBOutlet weak var utiArgumentsCheckbox : NSButton !
167167 @IBOutlet weak var utiArgumentsTextField : NSTextField !
168168
169169 @IBOutlet weak var utiPreprocessorCheckbox : NSButton !
@@ -189,7 +189,7 @@ class PreferencesViewController: NSViewController {
189189 }
190190 }
191191
192- /// Gliobal settings.
192+ /// Global settings.
193193 var settings : SCSHSettings ?
194194
195195 typealias HighlightPath = ( path: String , ver: String , embedded: Bool )
@@ -220,7 +220,7 @@ class PreferencesViewController: NSViewController {
220220 }
221221 }
222222
223- /// Show only UTI with customized settings.
223+ /// Show only UTI with custom settings.
224224 var filterOnlyChanged : Bool = false {
225225 didSet {
226226 guard oldValue != filterOnlyChanged else {
@@ -317,53 +317,53 @@ class PreferencesViewController: NSViewController {
317317 utiCustomCSSButton. isEnabled = utiCustomCSSCheckbox. state == . on && utiCustomCSSCheckbox. isEnabled
318318 utiCustomCSSImage. image = NSImage ( named: utiCustomCSSCheckbox. state == . on ? NSImage . statusAvailableName : NSImage . statusNoneName)
319319
320- utiFontChecbox . state = currentUTISettings. fontFamily != nil ? . on : . off
321- utiFontPreviewTextField. isEnabled = utiFontChecbox . state == . on
322- utiFontChooseButton. isEnabled = utiFontChecbox . state == . on
320+ utiFontCheckbox . state = currentUTISettings. fontFamily != nil ? . on : . off
321+ utiFontPreviewTextField. isEnabled = utiFontCheckbox . state == . on
322+ utiFontChooseButton. isEnabled = utiFontCheckbox . state == . on
323323 refreshFontPanel ( withFontFamily: currentUTISettings. fontFamily ?? settings? . fontFamily ?? " Menlo " , size: currentUTISettings. fontSize ?? settings? . fontSize ?? 12 , isGlobal: false )
324324
325- utiWordWrapChecbox . state = currentUTISettings. wordWrap != nil ? . on : . off
326- utiWordWrapPopup. isEnabled = utiWordWrapChecbox . state == . on
325+ utiWordWrapCheckbox . state = currentUTISettings. wordWrap != nil ? . on : . off
326+ utiWordWrapPopup. isEnabled = utiWordWrapCheckbox . state == . on
327327 switch currentUTISettings. wordWrap ?? settings? . wordWrap ?? . off {
328328 case . off:
329329 utiWordWrapPopup. selectItem ( at: 0 )
330330
331331 utiLineLengthTextField. isHidden = true
332- utiLineLenghLabel . isHidden = true
332+ utiLineLengthLabel . isHidden = true
333333
334334 utiLineNumbersPopup. menu? . item ( at: 2 ) ? . isEnabled = false
335335 case . simple:
336336 utiWordWrapPopup. selectItem ( at: 1 )
337337
338338 utiLineLengthTextField. isHidden = false
339- utiLineLenghLabel . isHidden = false
339+ utiLineLengthLabel . isHidden = false
340340
341341 utiLineNumbersPopup. menu? . item ( at: 2 ) ? . isEnabled = true
342342 case . standard:
343343 utiWordWrapPopup. selectItem ( at: 2 )
344344
345345 utiLineLengthTextField. isHidden = false
346- utiLineLenghLabel . isHidden = false
346+ utiLineLengthLabel . isHidden = false
347347
348348 utiLineNumbersPopup. menu? . item ( at: 2 ) ? . isEnabled = true
349349 }
350350 utiLineLengthTextField. integerValue = currentUTISettings. lineLength ?? settings? . lineLength ?? 80
351351
352- utiLineNumberChecbox . state = currentUTISettings. lineNumbers != nil ? . on : . off
353- utiLineNumbersPopup. isEnabled = utiLineNumberChecbox . state == . on
352+ utiLineNumberCheckbox . state = currentUTISettings. lineNumbers != nil ? . on : . off
353+ utiLineNumbersPopup. isEnabled = utiLineNumberCheckbox . state == . on
354354 switch currentUTISettings. lineNumbers ?? settings? . lineNumbers ?? . hidden {
355355 case . hidden:
356356 utiLineNumbersPopup. selectItem ( at: 0 )
357357 case . visible( let omittingWrapLines) :
358358 utiLineNumbersPopup. selectItem ( at: omittingWrapLines ? 2 : 1 )
359359 }
360360
361- utiTabSpacesChecbox . state = currentUTISettings. tabSpaces != nil ? . on : . off
362- utiTabSpacesSlider. isEnabled = utiTabSpacesChecbox . state == . on
361+ utiTabSpacesCheckbox . state = currentUTISettings. tabSpaces != nil ? . on : . off
362+ utiTabSpacesSlider. isEnabled = utiTabSpacesCheckbox . state == . on
363363 utiTabSpacesSlider. integerValue = currentUTISettings. tabSpaces ?? settings? . tabSpaces ?? 4
364364
365- utiArgumentsChecbox . state = currentUTISettings. extra != nil ? . on : . off
366- utiArgumentsTextField. isEnabled = utiArgumentsChecbox . state == . on
365+ utiArgumentsCheckbox . state = currentUTISettings. extra != nil ? . on : . off
366+ utiArgumentsTextField. isEnabled = utiArgumentsCheckbox . state == . on
367367 utiArgumentsTextField. stringValue = currentUTISettings. extra ?? settings? . extra ?? " "
368368
369369 utiPreprocessorCheckbox. state = currentUTISettings. preprocessor != nil ? . on : . off
@@ -444,7 +444,7 @@ class PreferencesViewController: NSViewController {
444444
445445 fetchSettings ( )
446446
447- // Register the objservers for theme save and delete notifications.
447+ // Register the observers for theme save and delete notifications.
448448 NotificationCenter . default. addObserver ( self , selector: #selector( onThemeDidSaved ( _: ) ) , name: . themeDidSaved, object: nil )
449449 NotificationCenter . default. addObserver ( self , selector: #selector( onThemeDidDeleted ( _: ) ) , name: . themeDidDeleted, object: nil )
450450 }
@@ -507,7 +507,7 @@ class PreferencesViewController: NSViewController {
507507
508508 // MARK: - Settings
509509
510- /// Filter the visible UTIs based on search cryteria .
510+ /// Filter the visible UTIs based on search criteria .
511511 func filterUTIs( ) {
512512 guard !filter. isEmpty || filterOnlyChanged else {
513513 fileTypes = self . allFileTypes
@@ -592,7 +592,7 @@ class PreferencesViewController: NSViewController {
592592 }
593593
594594 case 3 :
595- // Intialize all gui controls.
595+ // Initialize all gui controls.
596596 DispatchQueue . main. async {
597597 self . populateSettings ( )
598598 }
@@ -641,15 +641,15 @@ class PreferencesViewController: NSViewController {
641641 switch ln {
642642 case . off:
643643 wordWrapPopup. selectItem ( at: 0 )
644- lineLenghLabel . isHidden = true
644+ lineLengthLabel . isHidden = true
645645 lineLengthTextField. isHidden = true
646646 case . simple:
647647 wordWrapPopup. selectItem ( at: 1 )
648- lineLenghLabel . isHidden = false
648+ lineLengthLabel . isHidden = false
649649 lineLengthTextField. isHidden = false
650650 case . standard:
651651 wordWrapPopup. selectItem ( at: 2 )
652- lineLenghLabel . isHidden = false
652+ lineLengthLabel . isHidden = false
653653 lineLengthTextField. isHidden = false
654654 }
655655 }
@@ -714,7 +714,7 @@ class PreferencesViewController: NSViewController {
714714
715715 /// Get a theme by name.
716716 /// - parameters:
717- /// - name: Name of the theme. If has ! prefix search for a customized theme, otherwise fot a standalone theme.
717+ /// - name: Name of the theme. If has ! prefix search for a customized theme, otherwise for a standalone theme.
718718 func getTheme( name: String ? ) -> SCSHTheme ? {
719719 guard name != nil else {
720720 return nil
@@ -832,14 +832,14 @@ class PreferencesViewController: NSViewController {
832832 settings. css = ( settings. css != nil ? settings. css! : " " ) + utiCustomCSS
833833 }
834834
835- if utiFontChecbox . state == . on {
835+ if utiFontCheckbox . state == . on {
836836 settings. fontFamily = self . utiFontPreviewTextField. font? . fontName
837837 if let size = self . utiFontPreviewTextField. font? . pointSize {
838838 settings. fontSize = Float ( size)
839839 }
840840 }
841841
842- if utiWordWrapChecbox . state == . on {
842+ if utiWordWrapCheckbox . state == . on {
843843 switch wordWrapPopup. indexOfSelectedItem {
844844 case 0 :
845845 settings. wordWrap = . off
@@ -854,7 +854,7 @@ class PreferencesViewController: NSViewController {
854854 }
855855 }
856856
857- if utiLineNumberChecbox . state == . on {
857+ if utiLineNumberCheckbox . state == . on {
858858 switch lineNumbersPopup. indexOfSelectedItem {
859859 case 0 :
860860 settings. lineNumbers = . hidden
@@ -867,10 +867,10 @@ class PreferencesViewController: NSViewController {
867867 }
868868 }
869869
870- if utiTabSpacesChecbox . state == . on {
870+ if utiTabSpacesCheckbox . state == . on {
871871 settings. tabSpaces = tabSpacesSlider. integerValue
872872 }
873- if utiArgumentsChecbox . state == . on {
873+ if utiArgumentsCheckbox . state == . on {
874874 settings. extra = argumentsTextField. stringValue
875875 }
876876 if utiPreprocessorCheckbox. state == . on {
@@ -924,25 +924,25 @@ class PreferencesViewController: NSViewController {
924924 utiSettings. css = nil
925925 }
926926
927- if utiFontChecbox . state == . on {
927+ if utiFontCheckbox . state == . on {
928928 utiSettings. fontFamily = utiFontPreviewTextField. font? . fontName ?? " Menlo "
929929 utiSettings. fontSize = Float ( utiFontPreviewTextField. font? . pointSize ?? 12 )
930930 } else {
931931 utiSettings. fontFamily = nil
932932 utiSettings. fontSize = nil
933933 }
934934
935- if utiWordWrapChecbox . state == . on {
935+ if utiWordWrapCheckbox . state == . on {
936936 switch utiWordWrapPopup. indexOfSelectedItem {
937937 case 0 :
938938 utiSettings. wordWrap = . off
939939 utiSettings. lineLength = nil
940940 case 1 :
941941 utiSettings. wordWrap = . simple
942- utiSettings. lineLength = utiLineLenghLabel . integerValue
942+ utiSettings. lineLength = utiLineLengthLabel . integerValue
943943 case 2 :
944944 utiSettings. wordWrap = . standard
945- utiSettings. lineLength = utiLineLenghLabel . integerValue
945+ utiSettings. lineLength = utiLineLengthLabel . integerValue
946946 default :
947947 utiSettings. wordWrap = nil
948948 utiSettings. lineLength = nil
@@ -952,7 +952,7 @@ class PreferencesViewController: NSViewController {
952952 utiSettings. lineLength = nil
953953 }
954954
955- if utiLineNumberChecbox . state == . on {
955+ if utiLineNumberCheckbox . state == . on {
956956 switch utiLineNumbersPopup. indexOfSelectedItem {
957957 case 0 :
958958 utiSettings. lineNumbers = . hidden
@@ -971,13 +971,13 @@ class PreferencesViewController: NSViewController {
971971 utiSettings. lineNumbers = nil
972972 }
973973
974- if utiTabSpacesChecbox . state == . on {
974+ if utiTabSpacesCheckbox . state == . on {
975975 utiSettings. tabSpaces = utiTabSpacesSlider. integerValue
976976 } else {
977977 utiSettings. tabSpaces = nil
978978 }
979979
980- if utiArgumentsChecbox . state == . on {
980+ if utiArgumentsCheckbox . state == . on {
981981 utiSettings. extra = utiArgumentsTextField. stringValue
982982 } else {
983983 utiSettings. extra = nil
@@ -1006,7 +1006,7 @@ class PreferencesViewController: NSViewController {
10061006 /// Handle word wrap change.
10071007 @IBAction func handleWordWrapChange( _ sender: NSPopUpButton ) {
10081008 let lineTextField = sender == wordWrapPopup ? lineLengthTextField : utiLineLengthTextField
1009- let lineTextLabel = sender == wordWrapPopup ? lineLenghLabel : utiLineLenghLabel
1009+ let lineTextLabel = sender == wordWrapPopup ? lineLengthLabel : utiLineLengthLabel
10101010 let lineNumbersPopup = sender == wordWrapPopup ? self . lineNumbersPopup : utiLineNumbersPopup
10111011
10121012 lineTextField? . isHidden = sender. indexOfSelectedItem == 0
@@ -1197,7 +1197,7 @@ class PreferencesViewController: NSViewController {
11971197
11981198 // MARK: -
11991199
1200- /// Show only customized UTIs.
1200+ /// Show only custom UTIs.
12011201 @IBAction func handleFilterButton( _ sender: NSButton ) {
12021202 filterOnlyChanged = sender. state == . on
12031203
@@ -1383,7 +1383,7 @@ class PreferencesViewController: NSViewController {
13831383 return
13841384 }
13851385 guard let i = themes. firstIndex ( where: { $0. name == data. oldName && !$0. isStandalone } ) else {
1386- // Addeded a new theme.
1386+ // Added a new theme.
13871387 var t = themes
13881388 t. append ( theme)
13891389 t. sort { ( a, b) in
@@ -1436,7 +1436,7 @@ class PreferencesViewController: NSViewController {
14361436
14371437 var t = themes
14381438 t [ i] = theme
1439- // Resort the themes, the descriotion may has been changed.
1439+ // Resort the themes, the description may has been changed.
14401440 t. sort { ( a, b) in
14411441 return a. desc < b. desc
14421442 }
@@ -1550,7 +1550,7 @@ extension PreferencesViewController: NSFontChanging {
15501550 if tabView. selectedTabViewItem? . identifier as? String == " GlobalSettingsView " {
15511551 refreshFontPanel ( withFont: font, isGlobal: true )
15521552 refreshPreview ( self )
1553- } else if tabView. selectedTabViewItem? . identifier as? String == " SpecificSettingsView " && utiFontChecbox . state == . on {
1553+ } else if tabView. selectedTabViewItem? . identifier as? String == " SpecificSettingsView " && utiFontCheckbox . state == . on {
15541554 refreshFontPanel ( withFont: font, isGlobal: false )
15551555 refreshUtiPreview ( self )
15561556 }
0 commit comments