Difference between revisions of "IDE Window: Editor Options Mouse"

From Free Pascal wiki
Jump to navigationJump to search
(Excuded redirect)
 
(42 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{IDE Window: Editor Options Mouse}}
+
<noinclude>{{IDE Window: Editor Options Mouse}}<!--- This page may be used as template in other pages ---></noinclude>
  
 
<!-- do NOT REMOVE the div tags in the headers. They are used for the F1 help in the IDE. They must be kept, even if you rename the headers -->
 
<!-- do NOT REMOVE the div tags in the headers. They are used for the F1 help in the IDE. They must be kept, even if you rename the headers -->
  
= The Context Tree =
+
<u><b>This is part of the online help for the IDE. </b></u><br/>
 +
It describes the section: "Editor" / "Mouse". You can open the described dialog in your IDE via:<br/>
 +
*The menu: "Tools" => "Options" / Editor options ...
 +
*The source-editor pop-up menu: "Editor properties ...
  
The context tree is the Treeview just left to the Overview Grid. It currently has the entries:
+
<font size="+1"><u><b>Navigation</b></u></font><br/>
* '''Text'''
+
<table><tr><td>
** '''Selection'''
+
*<font size="+1">[[IDE_Window:_Editor_Options|Editor Options]]</font> Overview of all Editor Options
* '''Gutter'''
+
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td><td>
** '''Fold''' '''Tree'''
+
*<font size="+1">[[IDE Window: IDE Options Dialog|IDE Options]]</font> Overview of all options for the IDE</td>
*** '''Collapsed''' '''[+]'''
+
</tr></table>
*** '''Expanded''' '''[-]'''
 
** '''Line''' '''Numbers'''
 
  
You can define the behaviour of the Mouse-Buttons, dependent on the Context. E.g. clicking "selected text" may have a different action, than clicking unselected text.
+
----
  
If a click has no Entry in a specific context, it will use the content's parent(s) as fallback. E.g. If you click on "selected text", the configuration of the '''Selection''' node is searched first. If it has no action for your click, the parent node '''Text''' is searched. (By default this is used to assign "drag selected text" to the left button)
+
__TOC__
  
The '''Gutter''' and '''Text''' node are top level nodes, that do not have fall-backs. But the other nodes do fall back on their parents.
+
= General =
  
See also [[#The Priority|The Priority]] and [[#fallthrough|Fall-Through]] in the [[#The Action / Behaviour|The Action / Behaviour]] section.
+
== Hide mouse when typing ==
  
= The Click Configuration =
+
If the mouse is positioned over the editor, it will be hidden while you type. Any mouse-move, click, or menu action will make it visible again.
  
When you click a mouse button, the following items are checked to find the desired behaviour/action.
+
= Gutter =
  
== The Button ==
+
You can currently choose between two predefined modes for the gutter area
  
There are individual settings for the '''Left''', '''Right''' and '''Middle''' mouse Button
+
== Standard ==
* Extra Mouse Buttons (Button 4 and 5) work only on Windows
 
  
== <div id="ClickType"></div> The Click Type ==
+
All left-clicks on the gutter act when you press the mouse button down.
  
There are individual settings for '''Single''', '''Double''', '''Triple''' or '''Quad''' clicks.
+
== Extended ==
  
Please make sure you read the section on [[#Double to Quad Clicks|Double to Quad Clicks]]
+
All left-clicks on the gutter act when you release the mouse button. This mode allows the mouse to select text while being over the gutter.
  
There also is a setting '''Any''', which means the action is executed for any of the clicks. That would mean that a double click would execute the action twice. Or if the first part of the double-click changed the state of the object, the 2nd part would apply to the new state.
+
* Mouse pressed down and moved (either to other line, or into the text area), will make a selection. No action will be taken on when the mouse is released
*Example:
+
* Mouse pressed and released without moving it, will execute the normal gutter click action (breakpoint/fold)
:The left button on the code fold part is configured as '''Any'''. Each click will toggle between folded and unfolded. Therefore a double click will revert the action of the first.
 
:Without the '''Any''' setting, if you accidentally folded the wrong node, you would have to wait before you could click again to unfold it. (Because a quick 2nd click would count as double click, which wouldn't be matched by '''Single''')
 
  
Notes:
+
== Extended, right only (only in Lazarus 1.5) ==
* Not all of them are supported on all platforms
 
* Currently '''Double''', '''Triple''' and '''Quad''' only work for the left button and only for '''down''' clicks
 
  
== <div id="ClickDir"></div> The Click Direction ==
+
The Gutter-parts close to the text (line-numbers, change-indicator, and fold) act as describe in extended. The others act as described in standard.
  
A mouse click consists of a mouse-'''down''' and a mouse-'''up'''.
+
== Use line numbers to select lines (only in Lazarus 1.5) ==
  
Actions can be configured to happen on either of those 2 events.
+
Independent of the above setting. the gutter part showing the line numbers will always select the current line (mouse down), and additional full lines on mouse move.  
  
You can assign 2 different actions to the 2 events of the same click. They will be executed in the order of the events. However keep in mind that such a configuration may limit the action of the mouse-'''down''' event.
+
This selects in line-mode and can not be used to select part of a line by moving the mouse over the text area. To be able to start a normal selection (select any part of the line), use the "extended" setting above.
  
Notes:
+
= Text-area =
* Some events require the correct Click Direction to work properly:
 
** Start Selection, Drag Selection: Only works on '''down''' events, since it relies on the following mouse-movement-while-button-down. (It has a build in "end" at mouse button up)
 
** Context-Menu: On some WidgetSets this will only work reliable on mouse-'''up''' events
 
  
== <div id="ModKeys"></div> The Modifier Keys ==
+
== Right mouse includes caret move ==
  
Mouse behaviour can be modified by holding the '''Shift''', '''Alt''' or '''Ctrl''' key (or combinations of them)
+
Right mouse always triggers the context Menu. Setting the caret to the click location is optional.
  
At the time of the click-'''down''' or '''up''' the state of all three keys is checked. An action can be defined to:
+
== Drag Selection ==
* require one, some or all of the modifier keys pressed (Checkbox ticked)
 
* require one, some or all of the modifier keys *not* pressed (Checkbox not ticked)
 
* ignore the state of one, some or all of the modifier keys (Checkbox greyed)
 
  
For a given combination of Button, Click-Type, Click-Direction there must not be any ambiguity for the modifier keys. Example
+
You can use the left mouse button to drag an existing selection to a new location in the text. Hold ctrl while dragging to make a copy.
;Bad / Ambiguous:
 
* Left, Single, down Click with: Shift required pressed; Alt and Ctrl ignored
 
* Left, Single, down Click with: Ctrl required pressed; Alt and Shift ignored
 
: Now if you do this click, with both of Shift and Ctrl pressed, it would be unclear which of the 2 settings to use
 
;Correct:
 
* Left, Single, down Click with: Shift required pressed; Ctrl required un-pressed; Alt ignored
 
* Left, Single, down Click with: Ctrl required pressed; Shift required un-pressed; Alt ignored
 
If you whish Shift to be preferred (the shift action should be taken, if both modifier keys are pressed) then you must at an extra setting:
 
* Left, Single, down Click with: Ctrl required pressed; Shift required pressed; Alt ignored
 
  
 +
== Options no longer present (moved) in Lazarus 1.0 ==
  
;Default Fallback:
+
=== Alt-Key set column mode ===
There is one exception from this rule. If all modifier keys are set to be ignored, the entry becomes the fall-back for the button, click-type, click-dir configuration.
 
This is, if no configuration is found which has at least one modifier key required either pressed or un-pressed, then the fallback will be used.
 
  
;Note:
+
Use the entry <b>Select text (Columns)</b> from the drop down (for alt-button)
The Modifier Combinations used to detect the action on mouse down (or up) has nothing to do with the modifier Key, that certain actions use during there mouse-move phase.<br>
 
e.g. Dragging uses "ctrl" to copy the dragged text instead of moving it. However the use of "ctrl" for copy indication is during mouse move, so you can set start dragging to rely on any other Modifier key. It is however recommended to set '''Ctrl''' to greyed, so you can start dragging with the key pressed or un-pressed.<br>
 
This is different to using "alt" (or others) for column mode selection: Here the decision is made only at the time of click. Later changes of the "alt" key during mouse-move do not change the selection mode.
 
  
== <div id="Priority"></div> The Priority ==
+
If you use the left mouse button, then the dropdown for shift-alt-button will offer <b>Continue Select text (Columns) (Bound to Alt)</b>
  
It is possible to configure several equal (or overlapping / ambiguous) Clicks in the same Context. The Configuration with the highest Priority (lowest number (0 = top)) wins.
+
=== Double click selects line ===
  
This can be used for 2 purposes:
+
Use the drop downs in the "Left2" page
  
;Resolve Ambiguity:
+
== Actions  for each mouse button ==
# Left, Single, down Click, '''priority''' '''0''' with: Shift, Ctrl required pressed; Alt ignored
 
# Left, Single, down Click, '''priority''' '''1''' with: Shift required pressed; Ctrl, Alt ignored
 
Normally those two would conflict, because if you click with shift and ctrl then both will match. However due to the priority this can be resolved:
 
* Only Shift pressed: Only Config 2 (priority 1) does match. Config 2 is taken.
 
* Shift and Ctrl pressed: Both Config do match. Config 1 has higher priority (0), Config 1 is taken
 
  
 +
[[File:IDE_Options_mouse_choose_button.png]]
  
;Define Actions for Command Fall-through:
+
The dialog provides a setup page for each mouse button.
Sometimes a Command can not be executed at the given location. If the Command notices this, it will pass the Click on. The [[#fallthrough|Fall-Through]] first looks for further Commands in the same Context, but with lower priority. If none are found it will search parent context too.
+
;Left, Left2: The main button of a mouse.
* Not all Commands/Actions support Fall-through
+
;Right: The 2nd button of a mouse. (also known as context menu button)
* "Default Fallback" (modifier Keys) will act like any other entry in the Priority. If A click is matched by a "specific configuration" at priority 2 (low) and a "default fallback" at priority 1 (higher), then it will first be given to the "default fallback", and only if this supports and trigger Fall-through the event may go to the "specific config"
+
;Middle: Usually triggered by pressing (instead of turning) the wheel
* See Useful Examples: [[#Extend "Source Links" to jump Begin/End-pairs|Extend "Source Links" to jump Begin/End-pairs]]
+
;Extra1, Extra2: Only for 5 button mouses
 +
;Wheel: Actions for turning the wheel
  
= <div id="ActionHelp"></div>The Action / Behaviour =
+
Each page provides a list of actions for the indicated mouse button, with or without modifier keys.
 +
* The left-button without any modifier is fixed as "select text" and can not be modified.
 +
* Double and triple click is only supported for the left button (page "Left2").
  
Each mouse button event as defined above, can trigger some action. The same action can be assigned to more than one event. (IF 2 events have the same behaviour, then there modifier keys are not checked for ambiguity)
+
The modifier Keys must be an exact match. If "Ctrl-Button" is configured, then other combinations like ctrl-alt-button or ctrl-shift-button will not trigger this configuration.  
 +
* However there is an exception, if <b>all</b> combinations containing alt for this button are set to "Nothing/Default" then ctrl-alt-button will be treated as ctrl-button.
 +
* If all combinations of ctrl, alt and shift are set to "Nothing/Default" then they modifier keys will be ignored for this button, and the button always triggers the action set on the no-modifier-key dropdown.
 +
* On some OS certain combinations of modifier key with specific buttons, may be handled by the OS, and are not available.
  
;Move Caret checkbox: With each action you can define, if you whish the caret to be moved. However this only additionally enforces the caret move. If an action implicitly moves the caret, then this will happen, even if you uncheck the this box. (e.g. Selecting a block always moves the caret)
 
  
;Command options: Some commands take additional params to refine there behaviour
+
;Nothing/Default: No action, or action without modifier key
 +
;Select text: Selects text. An existing selection will be lost.
 +
;Select text (Columns): Selects text in column mode. An existing selection will be lost.
 +
;Select text (Lines): Selects text, full lines only. An existing selection will be lost.
 +
;Select current Word: Selects one word.
 +
;Select current Line (Text): Selects one line, without leading/trailing spaces.
 +
;Select current Line (Full): Selects one line, with leading/trailing spaces
 +
;Select current Paragraph: Selects one paragraph. Bound by empty lines.
 +
;Paste: Inserts the current selection. If there is no selection, then it depends on the OS, may insert (secondary) clipboard, or do nothing.
 +
;Jumps to implementation: Navigates pascal source via codetools. (Find implementation of identifier)
 +
;Jumps to implementation/other block end: Navigates pascal source... Also jumps between matching begin/end pairs
 +
;Add history point: Add your own History point (normally done by implementation jumps.
 +
;History back: Navigate to previous source location.
 +
;History forward: If you navigated back in history, go forward again.
 +
;Set free bookmark: Sets an available bookmark
 +
;Reset zoom: See mouse wheel, sets editor font size to default
 +
;Context Menu: normal editor context menu.
 +
;Context Menu (debug): debug section from editor context menu.
 +
;Context Menu (tab): Context menu for editor tabs (trigger anywhere in the editor area)
  
;Implicit mouse up action: Some events that occur on mouse '''down''' events implicitly assign a mouse '''up''' action for the current click. <br> E.g. dragging implicitly drops (inserts) the text when the button is released. <br> If any configured action is assigned to the mouse up, then the implicit action is performed first, the configured action is performed second.
+
The following are only available for the shift-left-button with or without alt or ctrl. If the left button (with or without alt or ctrl) is set to "select text" (or "select text (Columns/Line)") then one extra entry is listed as first entry in the dropdown. The entry allows to continue (extend) an existing selection. The entry will be one of the following:
 +
;Continue Select text:
 +
;Continue Select text (Columns/Line):
 +
;Continue Select text (...) (Bound to Alt,Ctrl Button): Continue/Extend an existing selection, using the same selection mode as the button without shift
  
<div id='fallthrough'></div>
+
=== Actions for mouse wheel ===
;Fall-Through:
 
Some Commands can not always be executed. For Example "Source Link Command" can only be executed, if above a link-able identifier. In cases where a command can not be executed, it may trigger a Fall-Through. This means the Click will behave as if the configuration had not existed, and consequentl a lower priority followed by the parent context will be searched.
 
<br>Note: Not all commands support this, even if they are not executed.
 
  
== No Action Command ==
+
The wheel can be set to scroll, at different speeds, or change the editor font size (zoom)
  
There are 2 uses for this:
+
Normal scroll is vertical,but automatically changes to horizontal, if the editor has no horizontal scroll bar (to few line).
;Move Caret: With "Move Caret" it will set the caret to the mouse location. This will unset an existing selection. It also prevents a new selection from being marked by moving the mouse. <br> If it occurs on '''down''' then the caret will be set to the location the mouse was pressed, never mind where you release the button
+
Horizontal can be enforced.
;Prevent fallback to parent node: In Context-Subnodes this can prevent a click from executing the parent node(s) action. <br> E.g. this is assigned to the FoldTree. It catches clicks that are neither on a [+] or [-] node. Otherwise they fall through to the normal Gutter and toggle a breakpoint.
 
  
 +
=== More about: Jumps to implementation/other block end ===
  
;Fall-Through: Never
+
by default, if you click on any identifier such as a function, variable or type name the IDE will jump to the declaration of this identifier (even into another unit).
  
== Selection Commands ==
+
This is the same feature that is available as key-shortcut (usually {{keypress|Alt|Up}}). See "Key Mapping" / "Codetools" / "Find declaration"
  
=== Block Selection Commands ===
+
"other block end" means that if you are not over an identifier, but instead over a "begin", "end" or matching brackets or similar then the jump will go to the matching word/bracket. On the Keyboard this is {{keypress|Ctrl|Q|K}}. See also: "Key Mapping" / "Codetools" / "Find block other end")
  
There are 3 Selection commands, for the 3 selection modes supported by SynEdit: '''Normal''', '''Column''' or '''Full-Lines'''.
+
= Advanced Options =
  
Note: All of them move the caret implicitly.
+
For advanced options please see here: [[IDE_Window:_EditorMouseOptionsAdvanced|Advanced Mouse Options]]
  
Each of those can be configured in 2 different ''Modes'':
+
Once you have made changes in the advanced settings, this page will show a warning that it does not represent your settings any more.
;Begin: Starts a new selection . If an old selection exists, it will be disregarded. The new Selections starts at the current mouse location.
 
;Continue: If an old selection exists, then it will be extend.<br>If there was no selection, then a new selection is created, which will start at the position the caret had before the event occurred, and range to the click position.
 
  
Those events should be assigned to mouse '''down''' events, in which case the selection will resize with any following mouse-movement until the mouse button is released. ('''Implicit mouse up action''')
+
In this case it also will no longer just follow the changes you make. Instead it will display a button which you must use to override the settings you made in the advanced page. A warning will be shown, if you have unsaved changes.
 
 
"Begin-Mode" on mouse '''up''' does nothing, but setting the caret. (Except currently for line mode, which selects the line).<br>
 
"Continue-Mode" on mouse '''up''' will extend the selection
 
 
 
 
 
;Fall-Through: Never
 
 
 
=== Item Selection Commands ===
 
 
 
Allow to select the Word, Line or Paragraph at the mouse position.
 
Once selected the selection will not extend, if the mouse moves.
 
 
 
"Line" supports 2 modes, either including leading/trailing spaces of the line or not.
 
 
 
Note: All of them move the caret implicitly.
 
 
 
 
 
;Fall-Through: Never
 
 
 
=== Drag Selection Command ===
 
 
 
Drags (Copies or moves) the current selection to a new position, following mouse movement. It will be pasted there if the button is released. ('''Implicit mouse up action''')
 
 
 
Independent of the modifier keys pressed at the time of the event occurring (or the configured mod, keys), it will check for the '''ctrl''' key at the time the dragged text is inserted. If Ctrl is pressed the text will be copied, otherwise moved.
 
 
 
Note: moves the caret implicitly.
 
 
 
 
 
;Fall-Through: If no text is selected. Or if the selection can not be dragged (Column or Line mode selection)
 
 
 
=== Quick copy Selection Command ===
 
 
 
Inserts a copy of the currently selected text at the mouse location. If no text is selected, inserts the content of the clipboard.
 
 
 
Note: moves the caret implicitly.
 
 
 
 
 
;Fall-Through: If no text is selected and the clipboard is empty
 
 
 
== Context Popup Menu ==
 
 
 
Note: GTK2: PopUp-Menu is recommended for use with ButtonUp only
 
 
 
 
 
;Fall-Through: Never
 
 
 
== Fold Commands ==
 
 
 
Fold commands are commonly assigned to the fold-tree-nodes, but can also be assigned to other context, like the text area.
 
 
 
The fold-tree has 3 context-nodes
 
;Fold Tree: Any area of the fold-tree, this can be [+], [-], |, or empty
 
:;Collapsed: The [+] only. This means the line has at least one collapsed section. It may have a mix of collapsed/expanded sections
 
:;Expanded: The [-] only. This means the line has at at only expanded sections (at least one)
 
 
 
Note, that if you configure a specific click (e.g. shift-left-down) for either [+] or [-] or both, then most likely you should add the same click with "no action" (or other default) to the parent "Fold Tree" node. Otherwise such a click if not on the [+]/[-] node will fall through to the gutter, and may trigger an action there.
 
 
 
=== Fold Commands ===
 
 
 
By default only acts on nodes starting on the line at the mouse location.
 
 
 
The following modes are available:
 
;One: Folds the "most inner" unfolded node starting on this line. This is the node that starts at the right most place in the line. Any node already folded is ignored, so if any unfolded node exists, one and exactly one node will be folded.<br>This is not necessarily the shortest fold-node (in amount of lines folded), as $region and begin folds can overlap.
 
;All: Folds all Nodes that start on this line
 
;At Caret: This only works if configured for the "Text" context. It folds the node which starts under the current mouse location. This allows you to click on a "begin" (or other keyword) to fold it. (Useful if more than one node starts at the line).
 
;Current: Folds the most inner node containing the current mouse location (the gutter is treated as "at the start of line"). It will search for the first fold-starting keyword (e.g "begin") in front of the current mouse location, whic has a block enclosing the mouse location (end is past mouse location). This may be above the current line.<br> If assigned to the gutter (or fold tree) this is always above the current line, unless the line starts with a keyword (no spaces before)
 
 
 
 
 
;Fall-Through:  (subject to change) Only in "At Caret" mode, if no fold starts under the mouse location
 
 
 
=== Unfold Commands ===
 
 
 
Only acts on nodes starting on the line at the mouse location.
 
 
 
The following modes are available:
 
;One: Folds the "most outer" folded node starting on this line. This is the node that starts at the left most place in the line.
 
;All: Unfolds all nodes that start at the current line
 
 
 
;Fall-Through: Never (subject to change)
 
 
 
=== Fold Popup Menu ===
 
 
 
Note: GTK2: PopUp-Menu is recommended for use with ButtonUp only
 
 
 
A pop up menu allowing you to see and change folds enclosing the current line
 
 
 
 
 
;Fall-Through: Never
 
 
 
== Source Link Command ==
 
 
 
Trigger jump to implementation.
 
 
 
The "underline" argument controls, if the curremt link under the mouse is highlighted (by an underline) while the modifier keys are pressed.
 
 
 
If you assign this command to a click with no modifier keys needed, you would get constant highlights (because the expected modifiers (none) are pressed). In this case you cn switch it off.
 
 
 
 
 
;Fall-Through: If no linkable identifier is below the mouse
 
 
 
== Breakpoint Command ==
 
 
 
Toggle breakpoint on this line
 
 
 
 
 
;Fall-Through: Never
 
 
 
== IDE-Command ==
 
 
 
Select from the same commands that are available via the Keyboard Config.
 
 
 
If the chosen Command depends on the current caret location, then it is recommended to tick "Move Caret".
 
 
 
 
 
;Fall-Through: Never
 
 
 
= Double to Quad Clicks =
 
 
 
* Note: Those are currently only working with left mouse
 
* Note: Those are currently only triggering Mouse Down
 
 
 
If you assign actions to double and triple click, you should aware that they always trigger the lesser clicks too.
 
 
 
This is: Doing a Triple-Click will first do a Single-Click (down and up) with the same Modifier Keys (none, shift, alt, ...), then a double click, then the triple. (At the time of the first click, SynEdit does not know there will be more clicks)
 
 
 
You should therefore take care of the actions assigned to those clicks.
 
 
 
* With the default (select, select word, select line, select paragraph) this is no problem. Selecting a Line (Triple) is not disturbed by selecting a Word (Double) first.
 
* If However you would assign MouseLink to the Single (or Double), and select Word to the Double (or Tripple, one more than the other), this would not work. Because by the time you do your last click, SynEdit already followed the Link (and will not undo this). In fact, if SynEdit followed a Link to an other File, then a new SynEdit became active, and would see your last click as a single click.
 
* This is not a bug. This is the correct behaviour
 
 
 
= Current Limitations =
 
 
 
* Double/Triple/Quad click only available for Left Mouse and only for mouse down (todo)
 
* Double/Triple/Quad may depend on OS
 
* Extra Mouse Buttons (Button 4 and 5) work only on Windows
 
* GTK2: PopUp-Menu is recommended for use with Button-Up only
 
* OS-Depended: Some clicks may be used by the Window-Manager, and not reach the IDE at all
 
 
 
= Useful Examples =
 
 
 
== Line Numbers in Gutter to select Lines ==
 
 
 
You can set the Line number part of the gutter to select text (full lines) instead of toggling a breakpoint. The Rest of the gutter (left to the line numbers) will still do breakpoints.
 
 
 
;Context Node: Gutter => Line Numbers
 
;Configuration: Left - Any - Down - All modifiers greyed
 
;Action: Line Selection - Mode: Begin
 
 
 
Setting Click to "Any" instead of "Single" means that double-clicks do not accidentally toggle breakpoints.
 
 
 
== Fold by clicking on Keyword ("begin") ==
 
 
 
Instead of folding a block by clicking on the [-] symbol in the gutter, you can fold a block by clicking on it's start keyword (e.g. "begin" or "$region"). this is useful if more than one block starts on the same line.
 
 
 
;Context Node: Text
 
;Configuration: Middle or Right - Single - Down - Ctrl or Alt
 
;Action: Fold Code - Nodes: At Caret
 
 
 
== Fold current block by clicking on vertical fold line ==
 
 
 
You can set a click on the vertical line ("|" below the [-] sign in the fold tree) to fold the enclosing node. This may be useful if the [-] is outside the visible area.
 
 
 
;Context Node: Gutter => Fold Tree
 
;Configuration: Left - Any - Down - All modifiers greyed
 
;Action: Fold Code - Nodes: Current Node
 
 
 
This replaces the default "No Action" Entry. The default entry (as will the substitute) prevents Fold-Tree-Gutter clicks to toggle breakpoints.
 
 
 
== Extend "Source Links" to jump Begin/End-pairs ==
 
 
 
The Source-Link command is only useful for certain identifiers. But a very similar command exist "Find block other End" (IDE-Command). This can be set as a [[#fallthrough|Fall-Through]]. In this case the same Click can tricker either of the 2 commands, depending on being above a link, or a begin end pair.
 
 
 
Since IDE-Commands do not support Fall-Through to a further Action thye must be the last in the order of priorities.
 
The "Source Link Command" does  support Fall-Through, so it can be tried first.
 
 
 
Keep the "Source Link Command" as per default:
 
;Context Node: Text
 
;Configuration: Left - Single - Up - Ctrl required pressed; Shift, Alt required unpressed
 
;Priority: 0 (highest)
 
;Action: Source Link - Underline: yes
 
 
 
Add a new entry
 
;Context Node: Text
 
;Configuration: Left - Single - Up - Ctrl required pressed; Shift, Alt required unpressed
 
;Priority: 1 (lower)
 
;Action: IDE-Command - Find block other end
 
 
 
Note: While links will be underlined, Begin/End pairs will not be underlined (but can be clicked)
 
 
 
== History Jumps (follow back the "Source Link" trail) ==
 
 
 
This is usually assigned to ctrl-h. Source-Links and similar actions keep a history of points visited. Youc can navigate this history backward and forward.
 
 
 
=== With a 5 Button Mouse ===
 
*Windows only
 
 
 
 
 
;Context Node: Text
 
;Configuration: Extra1 - Single - Down - Mod-Keys default fallback
 
;Action: Ide Command - Jump back
 
 
 
 
 
;Context Node: Text
 
;Configuration: Extra2 - Single - Down - Mod-Keys default fallback
 
;Action: Ide Command - Jump forward
 
 
 
=== With a 3 Button Mouse ===
 
 
 
You may assign this to something like ctrl-right mouse.
 
 
 
If you use the right button, then you must use it on button-up. Otherwise you will also get the context-menu
 
 
 
;Context Node: Text
 
;Configuration: Right - Single - up - Ctrl Required pressed, Others either greyed, or required un-pressed
 
;Action: Ide Command - Jump back
 

Latest revision as of 14:23, 30 January 2021

Deutsch (de) English (en)


This is part of the online help for the IDE.
It describes the section: "Editor" / "Mouse". You can open the described dialog in your IDE via:

  • The menu: "Tools" => "Options" / Editor options ...
  • The source-editor pop-up menu: "Editor properties ...

Navigation

     

General

Hide mouse when typing

If the mouse is positioned over the editor, it will be hidden while you type. Any mouse-move, click, or menu action will make it visible again.

Gutter

You can currently choose between two predefined modes for the gutter area

Standard

All left-clicks on the gutter act when you press the mouse button down.

Extended

All left-clicks on the gutter act when you release the mouse button. This mode allows the mouse to select text while being over the gutter.

  • Mouse pressed down and moved (either to other line, or into the text area), will make a selection. No action will be taken on when the mouse is released
  • Mouse pressed and released without moving it, will execute the normal gutter click action (breakpoint/fold)

Extended, right only (only in Lazarus 1.5)

The Gutter-parts close to the text (line-numbers, change-indicator, and fold) act as describe in extended. The others act as described in standard.

Use line numbers to select lines (only in Lazarus 1.5)

Independent of the above setting. the gutter part showing the line numbers will always select the current line (mouse down), and additional full lines on mouse move.

This selects in line-mode and can not be used to select part of a line by moving the mouse over the text area. To be able to start a normal selection (select any part of the line), use the "extended" setting above.

Text-area

Right mouse includes caret move

Right mouse always triggers the context Menu. Setting the caret to the click location is optional.

Drag Selection

You can use the left mouse button to drag an existing selection to a new location in the text. Hold ctrl while dragging to make a copy.

Options no longer present (moved) in Lazarus 1.0

Alt-Key set column mode

Use the entry Select text (Columns) from the drop down (for alt-button)

If you use the left mouse button, then the dropdown for shift-alt-button will offer Continue Select text (Columns) (Bound to Alt)

Double click selects line

Use the drop downs in the "Left2" page

Actions for each mouse button

IDE Options mouse choose button.png

The dialog provides a setup page for each mouse button.

Left, Left2
The main button of a mouse.
Right
The 2nd button of a mouse. (also known as context menu button)
Middle
Usually triggered by pressing (instead of turning) the wheel
Extra1, Extra2
Only for 5 button mouses
Wheel
Actions for turning the wheel

Each page provides a list of actions for the indicated mouse button, with or without modifier keys.

  • The left-button without any modifier is fixed as "select text" and can not be modified.
  • Double and triple click is only supported for the left button (page "Left2").

The modifier Keys must be an exact match. If "Ctrl-Button" is configured, then other combinations like ctrl-alt-button or ctrl-shift-button will not trigger this configuration.

  • However there is an exception, if all combinations containing alt for this button are set to "Nothing/Default" then ctrl-alt-button will be treated as ctrl-button.
  • If all combinations of ctrl, alt and shift are set to "Nothing/Default" then they modifier keys will be ignored for this button, and the button always triggers the action set on the no-modifier-key dropdown.
  • On some OS certain combinations of modifier key with specific buttons, may be handled by the OS, and are not available.


Nothing/Default
No action, or action without modifier key
Select text
Selects text. An existing selection will be lost.
Select text (Columns)
Selects text in column mode. An existing selection will be lost.
Select text (Lines)
Selects text, full lines only. An existing selection will be lost.
Select current Word
Selects one word.
Select current Line (Text)
Selects one line, without leading/trailing spaces.
Select current Line (Full)
Selects one line, with leading/trailing spaces
Select current Paragraph
Selects one paragraph. Bound by empty lines.
Paste
Inserts the current selection. If there is no selection, then it depends on the OS, may insert (secondary) clipboard, or do nothing.
Jumps to implementation
Navigates pascal source via codetools. (Find implementation of identifier)
Jumps to implementation/other block end
Navigates pascal source... Also jumps between matching begin/end pairs
Add history point
Add your own History point (normally done by implementation jumps.
History back
Navigate to previous source location.
History forward
If you navigated back in history, go forward again.
Set free bookmark
Sets an available bookmark
Reset zoom
See mouse wheel, sets editor font size to default
Context Menu
normal editor context menu.
Context Menu (debug)
debug section from editor context menu.
Context Menu (tab)
Context menu for editor tabs (trigger anywhere in the editor area)

The following are only available for the shift-left-button with or without alt or ctrl. If the left button (with or without alt or ctrl) is set to "select text" (or "select text (Columns/Line)") then one extra entry is listed as first entry in the dropdown. The entry allows to continue (extend) an existing selection. The entry will be one of the following:

Continue Select text
Continue Select text (Columns/Line)
Continue Select text (...) (Bound to Alt,Ctrl Button)
Continue/Extend an existing selection, using the same selection mode as the button without shift

Actions for mouse wheel

The wheel can be set to scroll, at different speeds, or change the editor font size (zoom)

Normal scroll is vertical,but automatically changes to horizontal, if the editor has no horizontal scroll bar (to few line). Horizontal can be enforced.

More about: Jumps to implementation/other block end

by default, if you click on any identifier such as a function, variable or type name the IDE will jump to the declaration of this identifier (even into another unit).

This is the same feature that is available as key-shortcut (usually Alt+). See "Key Mapping" / "Codetools" / "Find declaration"

"other block end" means that if you are not over an identifier, but instead over a "begin", "end" or matching brackets or similar then the jump will go to the matching word/bracket. On the Keyboard this is Ctrl+Q+K. See also: "Key Mapping" / "Codetools" / "Find block other end")

Advanced Options

For advanced options please see here: Advanced Mouse Options

Once you have made changes in the advanced settings, this page will show a warning that it does not represent your settings any more.

In this case it also will no longer just follow the changes you make. Instead it will display a button which you must use to override the settings you made in the advanced page. A warning will be shown, if you have unsaved changes.