Coder Social home page Coder Social logo

dail8859 / bettermultiselection Goto Github PK

View Code? Open in Web Editor NEW
97.0 97.0 5.0 156 KB

Notepad++ plugin to provide better cursor movements when using multiple selections

License: GNU General Public License v2.0

C++ 45.19% C 54.81%
notepad-plus-plus plugin

bettermultiselection's People

Contributors

cennoxx avatar dail8859 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bettermultiselection's Issues

Add up/down support

Hello,

You have home/end/left/right, let's add up and down.

Unfortunately I can't tell you how to program it, but that's my suggestion. xD

Thanks !

deletions at the beginning/end of lines without effect

delete key on line end
If I press the delete key on the line end, while having multiple cursors, nothing happens.
I can simulate the expected behaviour by pressing [shift]+[right] and [delete]
output

backspace on line start
Same problem on line start, while having multiple cursors, and pressing backspace, though this works for example, if I pressed enter before.
output2

Incompatibility of 3P auto-complete with BetterMultiSelection

3P - Progress Programmers Pal is a great Notepad++ Plugin which improves the default auto-complete function:

https://github.com/jcaillon/3P

The problem arises when both 3P auto-complete and BetterMultiSelection are active:

When trying to select the previous or next word in the auto-complete suggestion list by pressing the Down or Up keyboard arrows, BetterMultiSelection seems to intervene instead of 3P:

yq1zyyuytc

In the example posted above, pressing Down/Up arrows when the auto-complete box is active has the effect of moving all of the active cursors Up/Down (this is the behavior of BetterMultiSelection), instead of correctly selecting the previous/next word suggested in the auto-complete list.

Software/OS:

Notepad++ v7.5.9 32bit
3P - Progress Programmers Pal v1.8.3
BetterMultiSelection v1.3
Windows 10 x64

Thank you

Autocompletion popup and SCI_AUTOCSETMULTI SC_MULTIAUTOC_EACH

First off - great plugin, I just started using it and it definitely makes a difference.

I just also found SCI_AUTOCSETMULTI SC_MULTIAUTOC_EACH on Scintilla Documentation which allows me when typing in mutltiselection mode and a function or work autocomplete window pops-up, I can select and press "Enter" and the selected autocomplete is filled for ALL the multiselected cursor positions instead of just the main one.

With your plugin enabled, pressing enter in this situation ignores the autocompletion choice and just adds a carriage return at the current cursor locations. Note that if I use the mouse to double-click the desired autocomplete selection and your plugin is enabled, I get the desired effect - the selected autocomplete is inserted at all cursor positions. Also hitting the Tab key does the desired effect (although I have the Tab key Shortcut remapped to a QuickText plugin so I need to disable that for the Tab key to work, but it should on a default setup). All this leads me to believe it's in the way you handle the "Enter" (VK_RETURN) key perhaps.

I wonder if you can check for SCI_AUTOCACTIVE perhaps to see if an autocompletion window is present and then ignore the "Enter" key as a newline insertion? I haven't looked in detail at your code or all the Scintilla messages to see how to detect if an autocompletion window has popped-up.

Cheers.

Support SCI_DELWORDLEFT (Ctrl+Backspace) and SCI_DELWORDRIGHT (Ctrl+DEL) commands

Hi,

thanks for this plug-in, it's very useful.

I was wondering if it would be possible to support Scintilla's SCI_DELWORDLEFT (Ctrl+Backspace) and SCI_DELWORDRIGHT (Ctrl+DEL) commands.

Suppose I have three lines (| represents the multi-cursors):

one|
two two|
three three three|

If I invoke SCI_DELWORDLEFT (Ctrl+Backspace) I would expect the last word of each line to be removed, obtaining this result:

|
two|
three three|

Instead, this is the actual result:

one|
two two|
three three |

Likewise, if I put the multicursors at the beginning of the lines:

|one
|two two
|three three three

and I invoke SCI_DELWORDRIGHT (Ctrl+DEL) I would expect the first word of each line to be removed, obtaining this result:

|
|two
|three three

Instead, this is the actual result:

|one
|two two
|three three

Thanks.

Action on selection

Experiencing mild VIM withdrawal effects, I was wondering as to how one can perform an action on current selection. Your plugin comes to mind.

Say user has highlighted a word:
image

Would it be possible to create multiple cursors based on the highlight so they can be edited simultaneously?

Multiple selections copy/cut-paste

In Sublime Text, when multiple words are selected and copied or cut, then those get also pasted in the respective positions marked by the cursors (which clearly need to be equal to the number of the initial selections). A demonstration follows below:

img

Do you think something like this could be implemented in BetterMultiSelection?

Inconsistent pasting: column selection vs line selection

When a column area (Alt + mouse drag) is selected from bottom to top, copied and then pasted: the new copy is reversed by lines; this reversal does not happen with full or partial line selections made in the same bottom to top manner. Nor does it happen in any selection method (column, line, bottom to top, or top to bottom) with version 1.3 of the BetterMultiSelection plugin. The behavior still occurs when only the v1.4 plugin is installed (see attached debug info). Disabling the plugin (with the enable option unchecked) BEFORE making the bottom to top column selection does prevent the reversed line order when pasting, while disabling the plugin after making the bottom to top column selection will result in the reversed line order when pasted.
debug info.txt

Please add how to use to the readme file

Your plugin looks very interesting, but I cannot perform any selections as shown in the demo gif. I cannot find any instructions on plugin use. The plugin is enabled. Thank you.

MultipleSelectAddNext

In src/ScintillaEditor.h I found those two function:

  • MultipleSelectAddNext()
  • MultipleSelectAddEach()

I think that this is what VSCode has bound to the shortcuts ctrl-D and shift-ctrl-L. This makes the multi selection extremely fast and versatile. Can those functions be activated and bound to keyboard shortcuts?

Too much is deleted in specific cases

Seems like I've introduced an issue with 0a0ee31 (sorry for that). If several selections are made and the selection is extended to the end of the line and deleted, there is too much deleted. See image:
output

Multiple selections "undo"

It will be great if your plugin would be able to remember the multiple focus after undoing (Ctrl + Z). Now, after applying 'undo', the focus switches to normal focus on a single line.

If you want to better understand what I mean, you can try that in Sublime Text.

Add New Line support

Hi,
I use multiselection to create commands and, sometimes, commands need a confirmation.
With other programs (SynWrite/CudaText) I used to create "command lines", move to the end of the lines, press Enter (this will add an empty line between "command lines") and add a Y.

Step 1 - Ppaste a list of nodes:
HMD
H7D
HID
HPD
H5D

Step 2 - Use MultiLine to create "command lines":
del fil HMD *
del fil H7D *
del fil HID *
del fil HPD *
del fil H5D *

Step 3 - As del fil command need a confirmation, move to the end of each line, press Enter:
del fil HMD *

del fil H7D *

del fil HID *

del fil HPD *

del fil H5D *

Step 4 - Now there should be a caret on every new line and I can add the confirmation:
del fil HMD *
y
del fil H7D *
y
del fil HID *
y
del fil HPD *
y
del fil H5D *
y

Hope it will be possible to add this feature.

thinks

very userful,thinks to you.

Question about QScintilla multiselection

Hiya :)

I'd like to ask you something even if the question is not exactly related to your particular amazing project (just saw one gif showing the features and it looks really nice one)... So, how difficult would be implementing a similar behaviour on pyqt's QScintilla widget such as your project is doing right now on notepad++?

Asking you this cos 1 year ago I was aware Scintilla already was providing SCI_SETADDITIONALSELECTIONTYPING and SCI_ADDSELECTION tokens, but just using those wouldn't provide a nice multiselection behaviour like in SublimeText or your plugin... so yeah, how difficult do you think it'd be to achieve?

Thanks in advance.

entire file Multi Cursor feature request

First of all thanks for this great plugin! Do you think there is an easy way to implement multiline selection on an entire file? It would be incredibly useful on large files with thousands of lines, to press for example Shift + Alt + End/Start in order to have a multi-cursor on the entire file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.