Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes and improves plugin dragdropselected (#258)
* fixes and improves plugin dragdropselected - Tighter and neater code - Removed weird selection during drag - Ctrl+drag works if gnome's "ctrl to show mouse" is turned off - Added sticky mode to help against finger fatigue - Copied selections can now be placed adjacent to the original selection - Press Esc to abort a begun action - Added toggles for settings gui to enable/disable plugin and sticky mode during runtime * move isInSelection to DocView.dnd_isInSelection also adding boundry contraction algo and an alternative argument signature also renamed the selection vars for continuity throughout code * disable blinking caret during moves now caret is reliably rendered, great UX thanks @Guldoman for the hint. * update manifest.json * select pasted text after action and some comment updates * update manifest.json * add multi-selection support and some other tweaks to tidy and improve code * add custom get_selection_text - drag-items on same line are separated with spaces - also added local functions to dnd-table which is returned on load * remove stray caret when abborting drag inside selection if user drags selection but then releases mouse with cursor still in selection, there used to be an extra caret remaining. This commit removes it. * preserve selection direction * comment and typo fix in another comment * update readme at this point I think we can drop the 'basic' * return true in on_* events * disable text input during drag operations * selection restore no longer needed here since we return true in on_mouse_pressed, this is no longer needed * restore selections on esc * better to re-select anyway I'm not sure, may have been another issue, but this seems safer to also make sure there are no stray markers * comment typo * move escape key detection to command This allows users to define to another key(-combo) but it disables escape out of autocomplete suggestions. * use function predicate this ensures other commands get executed * allow clearing selection in sticky mode by clicking in empty * whitespace cleanup * add commands for toggles * check button on release just in case * clear out unused variable * comments * use Doc:position_offset same result maybe not as fast the tighter and easier to understand code is hopefully worth it * credits * [dragdropselected] tweak commands adding horrid dashes in command, makes them look prettier in command-view * [dragdropselected] add ghost of selection optionally have a ghost of selected text follow pointer. default is off and only 1 line
- Loading branch information