# HG changeset patch
# User Patrik Svestka <patrik.svestka@gmail.com>
# Date 1504788656 -7200
# Thu Sep 07 14:50:56 2017 +0200
# Branch jv
# Node ID b5bcb51d114a046a7867abab235ee90f99c97d2a
# Parent 6d0aaaa2ec779a7824d2fa0978fbfcd8073d4f38
Issue #165: Not all spaces are created equal
When only empty spaces are on a line and you perform backspace from line below it
you will delete all whitespaces if trimBlankLines is set to true; if false then
these whitespaces will be retained.
https://swing.fit.cvut.cz/projects/stx-jv/ticket/165
diff -r 6d0aaaa2ec77 -r b5bcb51d114a AbstractSettingsApplication.st
a
|
b
|
|
122 | 122 | showAcceptCancelBarInBrowser useCodeView2InTools |
123 | 123 | autoIndentInCodeView immediateCodeCompletion |
124 | 124 | codeCompletionOnControlKey codeCompletionOnTabKey |
125 | | selectionExtensionMode' |
| 125 | selectionExtensionMode trimBlankLines' |
126 | 126 | classVariableNames:'' |
127 | 127 | poolDictionaries:'' |
128 | 128 | privateIn:AbstractSettingsApplication |
… |
… |
|
4824 | 4824 | |
4825 | 4825 | ^ super flyByHelpSpec addPairsFrom:#( |
4826 | 4826 | |
4827 | | "/#resetToDefault |
4828 | | "/'Reset fonts back to original default values (as specified in the window style-file and OS settings)' |
4829 | | "/ |
4830 | | "/#changeToHighContrast |
4831 | | "/'Change settings for higher contrast. Useful for presentations and outdor operation' |
4832 | | "/ |
4833 | | "/#changeToBigFonts |
4834 | | "/'Change settings for bigger fonts. Useful for presentations' |
4835 | | "/ |
4836 | | "/#changeToHugeFonts |
4837 | | "/'Change settings for huge fonts. Useful for presentations' |
4838 | | "/ |
4839 | | "/#changeToSTXLook |
4840 | | "/'Change settings for an ST/X-like look (fixed-width code fonts)' |
4841 | | "/ |
4842 | | "/#changeToSqueakLook |
4843 | | "/'Change settings for a Squeak-like look (variable fonts)' |
4844 | | "/ |
4845 | | "/#changeToVisualAgeLook |
4846 | | "/'Change settings for a VisualAge-like look (bold variable fonts)' |
4847 | | |
4848 | | #immediateCodeCompletion |
4849 | | 'Show code completion suggestions as you type.\This is an experimental feature, please disable it if you encounter problems.' |
| 4827 | #alwaysPasteFileContents |
| 4828 | 'When pasting a file (from the Filebrowser or Explorer), always paste the file''s contents\without asking. If off, a dialog appears to ask the name or the contents of the file should be pasted' |
| 4829 | |
| 4830 | #autoIndentInCodeView |
| 4831 | 'Automatically position the cursor to a reasonably indented position when pressing the return key.\This affects editors which show code' |
4850 | 4832 | |
4851 | 4833 | #codeCompletionOnControlKey |
4852 | 4834 | 'Show code completion suggestions when you hit the CTRL key, and the character before the cursor is non-blank.\This is an experimental feature, please disable it if you encounter problems.\(CTRL-Space still works as usual, even if this is disabled)' |
… |
… |
|
4857 | 4839 | #codeCompletionViewKeyboardNavigationNeedsModifier |
4858 | 4840 | 'If on, cursor up/down are only passed to the floating completion view,\if a shift- or control modifier is pressed.\Check this, if you find it annoying, that cursor up/down is intercepted by a floating completion view.' |
4859 | 4841 | |
4860 | | #alwaysPasteFileContents |
4861 | | 'When pasting a file (from the Filebrowser or Explorer), always paste the file''s contents\without asking. If off, a dialog appears to ask the name or the contents of the file should be pasted' |
4862 | | |
4863 | | #autoIndentInCodeView |
4864 | | 'Automatically position the cursor to a reasonably indented position when pressing the return key.\This affects editors which show code' |
4865 | | |
4866 | 4842 | #extendedWordSelectMode |
4867 | 4843 | 'Controls if underlines will be treated as part of the word or not when selecting a word.\Many programming languages (including ST/X, but excluding Squeak and old ST80)\treat underline like a letter in identifiers' |
4868 | 4844 | |
| 4845 | #immediateCodeCompletion |
| 4846 | 'Show code completion suggestions as you type.\This is an experimental feature, please disable it if you encounter problems.' |
| 4847 | |
4869 | 4848 | #searchBoxIsModal |
4870 | 4849 | 'If off, a text search box is non-modal, and can be left floating beside an editor to mix search and edit operations.\If modal, it behaves as usual, blocking interaction with the editor while open' |
4871 | 4850 | |
4872 | 4851 | #selectAllWhenClickingBeyondEnd |
4873 | 4852 | 'If on, a click beyond (i.e. below) the end of the text selects the whole text.\If off, use quadruple-click to select all (triple-click to select a full line)' |
4874 | 4853 | |
| 4854 | #selectionExtensionModelStandard |
| 4855 | 'Standard behavior - most text editors and text widgets behave like this.' |
| 4856 | |
| 4857 | #selectionExtensionModelTraditional |
| 4858 | 'Traditional ST/X behavior (better but not standard).\Shift-End moves end of selection (if it is on the same line).\Shift-Home moves start of selection (if it is on the same line)' |
| 4859 | |
4875 | 4860 | #showAcceptCancelBar |
4876 | 4861 | 'Display an green-red-yellow accept-cancel bar to the left of the text.\Press green to accept, red to cancel, and yellow to compare against the original version.' |
4877 | 4862 | |
… |
… |
|
4881 | 4866 | #st80EditMode |
4882 | 4867 | 'Enable the ST-80 line-end/text-end cursor behavior.\There, the cursor cannot be positioned beyond the end of text, and cursor movement leads to the next/previous line.\This is similar to the behavior of other editors, such as "vi" or "emacs".\If off, the page is treated like a piece of paper, where any position can be reached immediately ("Rand-Editor" behavior)' |
4883 | 4868 | |
4884 | | |
4885 | 4869 | #startTextDragWithCTRL |
4886 | 4870 | 'Press CTRL to drag the selected text into another view' |
4887 | 4871 | |
4888 | 4872 | #tabStops4 |
4889 | 4873 | 'Controls if tab stops are multiples of 4 or 8 while editing.\Notice that this only affects the cursor positioning while editing, and that tabs are never part of the text internally.\The external (file-) representation always uses tab stops in multiples of 8.\Thus, when saving, one leading tab is generated for every 8 leading spaces,\and when reading a file, each tab is replaced by 8 spaces.\For ST/X, using multiple of 4 is recommended (the whole system was written in this style)' |
4890 | 4874 | |
| 4875 | #trimBlankLines |
| 4876 | 'Trims all the white-spaces at the line (when no other character is present).\An example: If true, and have one line with all white-spaces and go to one line below it and press backspace.\It will delete all the white-spaces above.' |
| 4877 | |
4891 | 4878 | #useNewCodeView2 |
4892 | 4879 | 'Use the new advanced CodeView2, which supports line numbers, advanced variable and selector highlighting,\and other useful programmer features' |
4893 | 4880 | |
4894 | 4881 | #whitespaceWordSelectMode |
4895 | 4882 | 'Controls if non-whitespace separators (such as fullstop, parentheses etc.) are treated as separator when selecting a word via double-click.\If off, only whitespace is treated as such. Useful when editing plain text, or code written in Lisp or Scheme' |
4896 | 4883 | |
4897 | | #selectionExtensionModelStandard |
4898 | | 'Standard behavior - most text editors and text widgets behave like this.' |
4899 | | |
4900 | | #selectionExtensionModelTraditional |
4901 | | 'Traditional ST/X behavior (better but not standard).\Shift-End moves end of selection (if it is on the same line).\Shift-Home moves start of selection (if it is on the same line)' |
4902 | | |
4903 | 4884 | ) |
4904 | | |
4905 | | "Created: / 17-03-2012 / 11:37:51 / cg" |
4906 | | "Modified: / 27-03-2014 / 10:19:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4907 | 4885 | ! ! |
4908 | 4886 | |
4909 | 4887 | !AbstractSettingsApplication::EditSettingsAppl class methodsFor:'image specs'! |
… |
… |
|
4940 | 4918 | name: 'Editor Settings' |
4941 | 4919 | flags: 1 |
4942 | 4920 | min: (Point 10 10) |
4943 | | bounds: (Rectangle 0 0 658 543) |
| 4921 | bounds: (Rectangle 0 0 658 803) |
4944 | 4922 | ) |
4945 | 4923 | component: |
4946 | 4924 | (SpecCollection |
… |
… |
|
4948 | 4926 | (VerticalPanelViewSpec |
4949 | 4927 | name: 'VerticalPanel1' |
4950 | 4928 | layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
| 4929 | activeHelpKey: trimBlankLines |
4951 | 4930 | horizontalLayout: fit |
4952 | 4931 | verticalLayout: top |
4953 | 4932 | horizontalSpace: 3 |
… |
… |
|
5078 | 5057 | translateLabel: true |
5079 | 5058 | extent: (Point 658 30) |
5080 | 5059 | ) |
| 5060 | (CheckBoxSpec |
| 5061 | label: 'Trim blank lines (removes all white spaces at once)' |
| 5062 | name: 'trimBlankLines' |
| 5063 | activeHelpKey: trimBlankLines |
| 5064 | model: trimBlankLines |
| 5065 | translateLabel: true |
| 5066 | extent: (Point 658 22) |
| 5067 | ) |
5081 | 5068 | (DividerSpec |
5082 | 5069 | name: 'Separator3' |
5083 | 5070 | extent: (Point 658 4) |
… |
… |
|
5199 | 5186 | #codeCompletionOnTabKey |
5200 | 5187 | #codeCompletionViewKeyboardNavigationNeedsModifier |
5201 | 5188 | #selectionExtensionMode |
| 5189 | #trimBlankLines |
5202 | 5190 | ) |
5203 | 5191 | |
5204 | 5192 | "Modified: / 07-03-2012 / 14:33:40 / cg" |
5205 | 5193 | "Modified: / 27-03-2014 / 10:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 5194 | "Modified: / 05-09-2017 / 14:45:24 / svestkap" |
5206 | 5195 | ! ! |
5207 | 5196 | |
5208 | 5197 | !AbstractSettingsApplication::EditSettingsAppl methodsFor:'aspects'! |
… |
… |
|
5223 | 5212 | #codeCompletionOnTabKey |
5224 | 5213 | #codeCompletionViewKeyboardNavigationNeedsModifier |
5225 | 5214 | #selectionExtensionMode |
| 5215 | #trimBlankLines |
5226 | 5216 | ) |
5227 | 5217 | |
5228 | 5218 | "Modified: / 07-03-2012 / 14:33:40 / cg" |
5229 | 5219 | "Modified: / 27-03-2014 / 10:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 5220 | "Modified: / 05-09-2017 / 13:45:23 / svestkap" |
5230 | 5221 | ! |
5231 | 5222 | |
5232 | 5223 | autoIndentInCodeView |
… |
… |
|
5354 | 5345 | ^ tabsIs4. |
5355 | 5346 | ! |
5356 | 5347 | |
| 5348 | trimBlankLines |
| 5349 | trimBlankLines isNil ifTrue:[ |
| 5350 | trimBlankLines := true asValue. |
| 5351 | trimBlankLines onChangeSend:#updateModifiedChannel to:self. |
| 5352 | ]. |
| 5353 | ^ trimBlankLines |
| 5354 | |
| 5355 | "Modified: / 05-09-2017 / 14:44:04 / svestkap" |
| 5356 | ! |
| 5357 | |
5357 | 5358 | useCodeView2InTools |
5358 | 5359 | useCodeView2InTools isNil ifTrue:[ |
5359 | 5360 | useCodeView2InTools := ValueHolder new. |