Permalink
Browse files

Use Core Data to store command history and directory history. This is…

… designed to improve performance. Previously, we'd write the whole plist of all history out on every new command or directory change, and it could easily be large (mine was 105kb).
  • Loading branch information...
1 parent bf32c20 commit cc6e0a3e41aba72b31c3ddc923aa37a9f64e6b20 @gnachman committed Oct 10, 2015
Showing with 3,265 additions and 1,394 deletions.
  1. +38 −0 Model.xcdatamodeld/Model.xcdatamodel/contents
  2. +159 −40 iTerm2.xcodeproj/project.pbxproj
  3. +1,005 −0 iTerm2XCTests/iTermShellHistoryTest.m
  4. +5 −6 iTerm2XCTests/iTermToolbeltTest.m
  5. +27 −0 iTermCommandHistoryCommandUseMO+CoreDataProperties.h
  6. +23 −0 iTermCommandHistoryCommandUseMO+CoreDataProperties.m
  7. +24 −0 iTermCommandHistoryCommandUseMO.h
  8. +16 −0 iTermCommandHistoryCommandUseMO.m
  9. +42 −0 iTermCommandHistoryEntryMO+CoreDataProperties.h
  10. +23 −0 iTermCommandHistoryEntryMO+CoreDataProperties.m
  11. +24 −0 iTermCommandHistoryEntryMO.h
  12. +17 −0 iTermCommandHistoryEntryMO.m
  13. +39 −0 iTermHostRecordMO+CoreDataProperties.h
  14. +21 −0 iTermHostRecordMO+CoreDataProperties.m
  15. +24 −0 iTermHostRecordMO.h
  16. +17 −0 iTermHostRecordMO.m
  17. +26 −0 iTermRecentDirectoryMO+CoreDataProperties.h
  18. +22 −0 iTermRecentDirectoryMO+CoreDataProperties.m
  19. +24 −0 iTermRecentDirectoryMO.h
  20. +16 −0 iTermRecentDirectoryMO.m
  21. +4 −2 sources/Autocomplete.h
  22. +12 −11 sources/Autocomplete.m
  23. +1 −1 sources/CaptureTrigger.m
  24. +0 −60 sources/CommandHistory.h
  25. +0 −329 sources/CommandHistory.m
  26. +0 −47 sources/CommandHistoryEntry.h
  27. +0 −148 sources/CommandHistoryEntry.m
  28. +1 −0 sources/CommandHistoryPopup.h
  29. +9 −8 sources/CommandHistoryPopup.m
  30. +0 −33 sources/CommandUse.h
  31. +0 −73 sources/CommandUse.m
  32. +2 −2 sources/DirectoriesPopup.h
  33. +9 −4 sources/DirectoriesPopup.m
  34. +2 −5 sources/GeneralPreferencesViewController.m
  35. +1 −1 sources/ITAddressBookMgr.h
  36. +5 −5 sources/ITAddressBookMgr.m
  37. +2 −1 sources/PTYSession.h
  38. +15 −18 sources/PTYSession.m
  39. +1 −1 sources/PTYTextView.m
  40. +1 −1 sources/ProfileListView.m
  41. +3 −3 sources/ProfileModel.m
  42. +1 −1 sources/ProfilePreferencesViewController.m
  43. +1 −1 sources/ProfileTableRow.m
  44. +3 −2 sources/ProfilesAdvancedPreferencesViewController.m
  45. +1 −1 sources/ProfilesGeneralPreferencesViewController.m
  46. +3 −2 sources/ProfilesTerminalPreferencesViewController.m
  47. +17 −18 sources/PseudoTerminal.m
  48. +3 −3 sources/ToolCapturedOutputView.m
  49. +2 −2 sources/ToolCommandHistoryView.h
  50. +19 −17 sources/ToolCommandHistoryView.m
  51. +21 −15 sources/ToolDirectoriesView.m
  52. +12 −10 sources/VT100Screen.m
  53. +26 −0 sources/iTermCommandHistoryCommandUseMO+Addtions.h
  54. +62 −0 sources/iTermCommandHistoryCommandUseMO+Addtions.m
  55. +30 −0 sources/iTermCommandHistoryEntryMO+Additions.h
  56. +120 −0 sources/iTermCommandHistoryEntryMO+Additions.m
  57. +3 −3 sources/iTermController.m
  58. +0 −52 sources/iTermDirectoriesModel.h
  59. +0 −464 sources/iTermDirectoriesModel.m
  60. +22 −0 sources/iTermDirectoryTree.h
  61. +93 −0 sources/iTermDirectoryTree.m
  62. +22 −0 sources/iTermDirectoryTreeNode.h
  63. +60 −0 sources/iTermDirectoryTreeNode.m
  64. +3 −2 sources/iTermEditKeyActionWindowController.m
  65. +18 −0 sources/iTermHostRecordMO+Additions.h
  66. +26 −0 sources/iTermHostRecordMO+Additions.m
  67. +1 −1 sources/iTermProfilePreferences.m
  68. +28 −0 sources/iTermRecentDirectoryMO+Additions.h
  69. +115 −0 sources/iTermRecentDirectoryMO+Additions.m
  70. +115 −0 sources/iTermShellHistoryController.h
  71. +776 −0 sources/iTermShellHistoryController.m
  72. +2 −1 sources/iTermToolWrapper.h
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="8195" systemVersion="15A282b" minimumToolsVersion="Xcode 7.0">
+ <entity name="CommandHistoryCommandUse" representedClassName="iTermCommandHistoryCommandUseMO" syncable="YES">
+ <attribute name="code" optional="YES" attributeType="Integer 32" syncable="YES"/>
+ <attribute name="command" optional="YES" attributeType="String" syncable="YES"/>
+ <attribute name="directory" optional="YES" attributeType="String" syncable="YES"/>
+ <attribute name="markGuid" optional="YES" attributeType="String" syncable="YES"/>
+ <attribute name="time" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
+ <relationship name="entry" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CommandHistoryEntry" inverseName="uses" inverseEntity="CommandHistoryEntry" syncable="YES"/>
+ </entity>
+ <entity name="CommandHistoryEntry" representedClassName="iTermCommandHistoryEntryMO" syncable="YES">
+ <attribute name="command" optional="YES" attributeType="String" syncable="YES"/>
+ <attribute name="matchLocation" optional="YES" transient="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
+ <attribute name="numberOfUses" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
+ <attribute name="timeOfLastUse" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
+ <relationship name="remoteHost" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="HostRecord" inverseName="entries" inverseEntity="HostRecord" syncable="YES"/>
+ <relationship name="uses" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="CommandHistoryCommandUse" inverseName="entry" inverseEntity="CommandHistoryCommandUse" syncable="YES"/>
+ </entity>
+ <entity name="HostRecord" representedClassName="iTermHostRecordMO" syncable="YES">
+ <attribute name="hostname" optional="YES" attributeType="String" syncable="YES"/>
+ <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
+ <relationship name="directories" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="RecentDirectory" inverseName="remoteHost" inverseEntity="RecentDirectory" syncable="YES"/>
+ <relationship name="entries" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="CommandHistoryEntry" inverseName="remoteHost" inverseEntity="CommandHistoryEntry" syncable="YES"/>
+ </entity>
+ <entity name="RecentDirectory" representedClassName="iTermRecentDirectoryMO" syncable="YES">
+ <attribute name="lastUse" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
+ <attribute name="path" attributeType="String" syncable="YES"/>
+ <attribute name="starred" attributeType="Boolean" defaultValueString="NO" syncable="YES"/>
+ <attribute name="useCount" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
+ <relationship name="remoteHost" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="HostRecord" inverseName="directories" inverseEntity="HostRecord" syncable="YES"/>
+ </entity>
+ <elements>
+ <element name="HostRecord" positionX="0" positionY="0" width="128" height="105"/>
+ <element name="CommandHistoryCommandUse" positionX="0" positionY="0" width="128" height="135"/>
+ <element name="CommandHistoryEntry" positionX="0" positionY="0" width="128" height="135"/>
+ <element name="RecentDirectory" positionX="18" positionY="63" width="128" height="120"/>
+ </elements>
+</model>
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit cc6e0a3

Please sign in to comment.