Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking on the line number #5394

Closed
timea-techgirl opened this issue Mar 7, 2019 · 25 comments
Closed

Clicking on the line number #5394

timea-techgirl opened this issue Mar 7, 2019 · 25 comments

Comments

@timea-techgirl
Copy link

timea-techgirl commented Mar 7, 2019

Description of the Issue

Clicking on the line number with the reverse mouse arrow selects a statement along with "newline". I use this to quickly drag and drop many statements but I want notepad++ to select the statement without the newline.

Now I have to remove the newline after dragging and dropping each time. It's a lot of work for me. I hope it could select the line without newline.

Can you please add an option to select a line without newline by clicking on line number? I really need it.

Thanks

@sasumner
Copy link
Contributor

sasumner commented Mar 7, 2019

There's a plugin called "Visual Studio Line Copy" that will copy the current line if no selection is active when invoked. You might want to try it, but I suspect that it will also carry along the line-ending characters. A script could definitely/easily be written to do what, though, if you have interest in that (it would have to be tied to a keycombo, though).

@timea-techgirl
Copy link
Author

Doesn't work. The plugin is not even getting detected. I tried all 3 that's available.

@chcg
Copy link
Contributor

chcg commented Mar 8, 2019

@timikesmarky The plugin "Visual Studio Line Copy" is available with N++ 7.6.4 from the PluginAdmin list. It is working for me. It copies indeed also the line-ending as sasummer expected.

@sasumner
Copy link
Contributor

sasumner commented Mar 8, 2019

The plugin is not even getting detected.

Don't know what version of Notepad++ you have. Sadly, the way plugins work is currently having a major overhaul. I'm not interested in supporting that mess. If you ever get plugins working and would want to use the Pythonscript plugin, here's a short script for that which does what you want. You simply bind it to a keycombo and then when you invoke it, it copies the line the caret is currently on to the clipboard without any line-ending characters on the end. Remove the # from the last line if you don't want the line copied to remain highlighted/selected.

c = editor.getCurrentPos()
p = editor.positionFromLine(editor.lineFromPosition(c))
l = editor.getCurLine().rstrip('\r\n')
editor.setSelection(p, p + len(l))
editor.copy()
#editor.setSelection(c, c)

@timea-techgirl
Copy link
Author

Thank you for your time. I had 7.6.2 before. I installed 7.6.4 just now to check out visual studio line copy. However, it copies the newline.

As I see, pythonscript plugin will not work on 7.6.x

I hope @donho can implement this option directly in notepad++.

However I have also raised an issue with Visual studio line copy developer and hope he can implement this request.

@sasumner
Copy link
Contributor

sasumner commented Mar 8, 2019

pythonscript plugin will not work on 7.6.x

I think it will, it just needs some futzing. Because I haven't joined the 7.6.x masses yet, I can't tell you how to make it work. :)

donho can implement this option directly

also raised an issue with Visual studio line copy developer

Sure, I understand. But there are no guarantees and no timelines.

@MetaChuh
Copy link

MetaChuh commented Mar 8, 2019

@timikesmarky

if you are not a notepad++ community visitor yet, you are very welcome to visit us over at the
>>> notepad++ community forum <<<, to exchange your information and questions, with a wider audience of devs and regular users.
(you don't have to create a new account, just sign in with your existing github or google account.)

if you would like to install the pythonscript plugin, here is the ...

complete guide to install the latest 1.3.0.0 pythonscript on notepad++ 7.6.4:

for notepad++ 7.6.4, 64 bit (installed version):

  • download and extract PythonScript_Full_1.3.0.0_x64.zip from >>> here <<< to your desktop.
    note: do not use any other available release type, except this zip.

  • open %ProgramFiles%\Notepad++\plugins\ in windows explorer and create a folder called PythonScript.

  • copy PythonScript.dll from the plugins folder of this extracted zip to:
    %ProgramFiles%\Notepad++\plugins\PythonScript\PythonScript.dll

  • copy python27.dll from this extracted zip to:
    %ProgramFiles%\Notepad++\python27.dll

  • copy the folders scripts containing machine level scripts and lib containing python libraries, from the zip's plugins\PythonScript folder to:
    %ProgramFiles%\Notepad++\plugins\PythonScript\

for notepad++ 7.6.4, 32 bit (installed version):

  • download and extract PythonScript_Full_1.3.0.0.zip from >>> here <<< to your desktop.
    note: do not use any other available release type, except this zip.

  • open %ProgramFiles(x86)%\Notepad++\plugins\ in windows explorer and create a folder called PythonScript.

  • copy PythonScript.dll from the plugins folder of this extracted zip to:
    %ProgramFiles(x86)%\Notepad++\plugins\PythonScript\PythonScript.dll

  • copy python27.dll from this extracted zip to:
    %ProgramFiles(x86)%\Notepad++\python27.dll

  • copy the folders scripts containing machine level scripts and lib containing python libraries, from the zip's plugins\PythonScript folder to:
    %ProgramFiles(x86)%\Notepad++\plugins\PythonScript\

@timea-techgirl
Copy link
Author

Thank you! I just moved PythonScript.dll to the PythonScript directory and all others intact and it worked. That's the summary of these instructions.

@sasumner I created a new script and saved your code. However, it's not working when I copy a line. I saw that the script is running but it's not copying without newline with ctrl+c
What do you mean by binding a keycombo? How can I do that?

@sasumner
Copy link
Contributor

sasumner commented Mar 8, 2019

Right, ctrl+c is the same ctrl+c as before.

Binding a script to a keycombo is a 2-step procedure. First go to Configuration... in the Pythonscript plugin. Click on your script in the upper window and then press the Add button above "Menu items". Second, In Notepad++'s Settings -> Shortcut Mapper window, on the Plugins tab you will find Pythonscript and your script listed there; you can bind any key you like to it with this user interface. (Maybe a restart of Notepad++ is needed between the steps).

@timea-techgirl
Copy link
Author

Thanks. I assigned ctrl + c but I can't copy custom selections anymore. I don't like to use another shortcut. I'm too used to this.

I also want to drag and drop the statements by clicking on the line number row without the new line. I drag and drop more than copying with shortcut. So, this workaround is not too helpful for me.

@MetaChuh
Copy link

MetaChuh commented Mar 8, 2019

@timikesmarky

if it suffices you, to copy the line at the cursor to your clipboard with [shift]+[ctrl]+[c], completely trimmed of leading spaces, tabs and trailing line feeds, there's a simple alternative, only using the built in functions:

  • open %AppData%\Notepad++\shortcuts.xml in notepad++.
  • paste the following code to your <Macros> section:
        <Macro name="Copy Line" Ctrl="yes" Alt="no" Shift="yes" Key="67">
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2178" wParam="0" lParam="0" sParam="" />
        </Macro>
  • save shortcuts.xml.
  • restart notepad++.

now regardless of where you put your cursor in any line, [shift]+[ctrl]+[c] will trim-select the whole line and copy it to your clipboard.
paste it as usual using [ctrl]+[v] 😉

source: https://notepad-plus-plus.org/community/topic/84/how-to-prevent-newline-character-when-marking-a-line by our regex guru guy038.

@sasumner
Copy link
Contributor

sasumner commented Mar 8, 2019

@timikesmarky said:

I'm too used to this.

So...sit around and wait for some indeterminate amount of time (or perhaps..and probably...forever) for your feature request to be adopted into Notepad++. For myself, I would much rather adapt my workflow slightly and have a solution today.

I also want to drag and drop the statements by clicking on the line number row without the new line. I drag and drop more than copying with shortcut.

That's interesting. But you are probably in the ~0.1% minority where such a thing is useful. I can't think of a time where I would have found that useful. Probably a developer would also "pass" on such a request as non-useful.

@MetaChuh , I would have likely gone for the macro solution myself if I could have found that community link. I wasn't going to do it "from scratch" because I remember (or rather don't exactly remember) there is weirdness with the home/end keys in certain cases. Regardless, I don't think your solution is going to make the requester happy here because it adds the shift key to the ctrl+c combo and the requester has already shown that they aren't inclined to modify their workflow.

@MetaChuh
Copy link

MetaChuh commented Mar 8, 2019

@sasumner

I would have likely gone for the macro solution myself if I could have found that community link.

maybe it's time to break your abstinence ... just for using the search function of course. 😉

I don't think your solution is going to make the requester happy here because it adds the shift key to the ctrl+c combo and the requester has already shown that they aren't inclined to modify their workflow.

we have @pryrt that always shows us how to never lose your temper 🙏

@pryrt
Copy link
Contributor

pryrt commented Mar 8, 2019

Could a check be added @sasumner 's PythonScript solution, akin to "if selection already exists, just copy that selection normally; otherwise, run @sasumner's script? Would that solve the single keystroke having both meanings? Or is there a subtlety I've missed?

we have @pryrt that always shows us how to never lose your temper

"always" and "never" involve very long timespans. Even my halo is likely to be tarnished on occasion. 😇

@sasumner
Copy link
Contributor

sasumner commented Mar 8, 2019

@pryrt , yea, it wasn't my intent to make the little script bigger and all-encompassing. :)

@timea-techgirl
Copy link
Author

@MetaChuh Why is this closed?

@sasumner
Copy link
Contributor

@timikesmarky Likely because for the majority of Notepad++ users the existing functionality of clicking on the line number is the desired functionality.

@timea-techgirl
Copy link
Author

@sasumner That's exactly what I use too. I click on a line number and drag it to other programs. But when I click on line number, it selects a new line. I just want it to select without new line. That's what I've been asking.

@sasumner
Copy link
Contributor

@timikesmarky Your desire is well-understood. What I'm saying is that for most Notepad++ users, they want the line-ending to go along with the line in this type of select-text operation, so the selection makes total sense the way it is. It is just my guess, but I think that is why the issue was closed -- it isn't going to be acted upon, so it got closed to clear up the clutter.

@timea-techgirl
Copy link
Author

That's sad. I really use it a lot and it would have saved me a lot of time.

@sasumner
Copy link
Contributor

Did you try the keyboard macro mentioned above? This could be another reason for closure of this issue: An alternative mechanism exists.

@timea-techgirl
Copy link
Author

Yes, that's not useful to me. I wanted to drag the lines, can't use my left hand. :(

@sasumner
Copy link
Contributor

Hmmm. Copying without the line-ending sort-of makes sense to me, but dragging is moving, and such an operation would leave the line-ending in its original location, which seems like it would need "cleaning up" later. So it is either clean it up on the original line after dropping, or clean it up in the original location. I'm simply trying to understand the use-case here.

@MetaChuh
Copy link

@timikesmarky

Why is this closed?

one of the reasons is, that 1 1/2 months of zero activity is a lot (for you 😉)

usually this indicates, that a user has either used one of the suggestions given, like the ones from above, or gotten accustomed to the way it is.

there is also a very high probability, that you would have forgotten about filing this issue by now, if it wouldn't have been for that pesky notification you've just got 😄

another reason is, that the select and drag line without line feed feature will currently not be implemented, as it can be done with the copy line macro from above, followed by dragging the copied and selected line to where you want it to be, without any line feeds moved.

ps: you can still post here or at the notepad++ community about that, but i have to close this issue as the feature will not be implemented for now.

is it ok with you ?

best regards.


general notes:

please close your issues as soon as you are satisfied, to help
keeping the notepad++ issue tracker clean.

when creating a new issue, please provide all information as shown at the issue template.
your notepad++ debug info is part of the minimum requirements.
(? > Debug Info... > Copy debug info into clipboard).

please also conduct a search at the issue tracker beforehand, to check if a similar issue
already exists.

for general questions, or if it is not sure, whether your issue is directly related to
the notepad++ source code, please visit us at the notepad++ community forum, and
search if related topics exists. you are welcome to post either at similar
topics, or to create a new topic at Help Wanted or General Discussion.
(no extra account is needed, just use your github account to sign in)

                        Click here to visit the Notepad++ Community Forum                         

@timea-techgirl
Copy link
Author

My issue was different from the workarounds I received.
I'm not using these workarounds as it's not useful for me. I can only use my right hand with the mouse and I need to drag without the new line.

It's sad if it can't be implemented. I have to accept it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants