Sublime Forum

Un-usual paste {CTRL + V} || paste not working as intended

#1

Please help me fix this !

0 Likes

#2

I guess you installed some plugin.
Try sublime.log_commands(True) in the console to see what is called when you type paste, it should help identified which plugin is creating the issue.

0 Likes

#3

You you reproduce it on a clean install?

  1. https://www.sublimetext.com/docs/3/revert.html

It seems that you are coping the whole with empty selection. You need to select the text you want to copy, otherwise it will paste the whole line. Related:

  1. https://github.com/SublimeTextIssues/Core/issues/1635 Paste and Indent does not work for whole lines copied/cut
0 Likes

#4

i did a fresh install and using with no plugins. The error reproduces even on fresh install

0 Likes

#5

You need to select the text, if want to copy and paste it, otherwise if you do it on a line without any selection, it will also copy the whole line + the new line character, and when you paste it, it will paste the whole line + the new line character, which will create a new line above the current position.

0 Likes

#7

You can replace the default behavior by creating a Sublime Text macro and a key bind for it on the Ctrl+C key:

Packages/User/SelectLineNoEOL.sublime-macro

[
    { "command": "move_to", "args": { "to": "hardbol" } },
    { "command": "move_to", "args": { "to": "eol", "extend": true } },
    { "command": "copy" },
]

Default.sublime-keymap

    { "keys": ["ctrl+c"], "command": "run_macro_file",
        "args": {"file": "res://Packages/User/SelectLineNoEOL.sublime-macro"},
        "context":
        [
            { 
                "key": "selection_empty", "operator": "equal",
                "operand": true, "match_all": true,
            },
        ],
    },

I think I had saw another thread with a plugin which does this, but I could not find it.

Related threads:

  1. forum#14576 How to disable selecting newline on triple click?
  2. forum#14933 [ST3]Copy blank line using yy;p (Vi), paste one extra line
  3. forum#21266 How to disable the line-copy feature
  4. forum#11547 Copy with nothing selected copies the current line
  5. forum#869 [Feature request] Option to disable copy of whole
  6. forum#1012 Ctrl-c issue
  7. forum#21437 How to copy line with no \n?
0 Likes

#8

okay! thanks

0 Likes

#9

I was having the same bug in all file extensions. I have solved it by removing the bugged plugin “Emmet Style Reflector”.

1 Like