Skip to content

Conversation

@saulaxel
Copy link
Contributor

The lose of one column issue with 'virtualedit' wasn't related with the
longest line as previously thought, but with the first line (smallest
one) of selection, so changing it fixes now for real (hopefully) the bug
of losing one column after moving.

Using "range" in functions that didn't used visual selection was a
problem when (a:firstline + count) greater than the last line so that
range was deleted and replaced with at the function calls.

The name 'are_same_line' was really referring to a column, so it was
renamed after 'are_same_cols'

Create function to initialize configurations variables to its defaults.

The variable g:move_map_key can also be a dictionary to permit
enabling/disabling of parts of the default mappings using the entries
'vertical' and 'horizontal' and its subentries 'normal' and 'visual'.

The lose of one column issue with 'virtualedit' wasn't related with the
longest line as previously thought, but with the first line (smallest
one) of selection, so changing it fixes now for real (hopefully) the bug
of losing one column after moving.

Using "range" in functions that didn't used visual selection was a
problem when (a:firstline + count) greater than the last line so that
range was deleted and replaced with <C-u> at the function calls.

The name 'are_same_line' was really referring to a column, so it was
renamed after 'are_same_cols'

Create function to initialize configurations variables to its defaults.
The variable g:move_map_key can also be a dictionary to permit
enabling/disabling of parts of the default mappings using the entries
'vertical' and 'horizontal' and its subentries 'normal' and 'visual'.
Copy link
Owner

@matze matze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still lost the first column and since I enabled listchars I see another issue: in visual blocks with multiple lines and different line lengths, trailing spaces are inserted when shifting left and right.

let l:distance = v:count ? v:count : 1
let l:min_col = min([col("'<"), col("'>")])

" Having 'virtualenv' set to 'onemore' fixes problem of one more movement
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone seems to write a lot of Python code as well ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't find a way to avoid inserting trailing spaces after a left/right move. But found that just removing the spaces after those operations is a possible solution. It is not exactly the same as not inserting them, because removing after an operation can also delete existing (possible wanted) spaces but this solution still will do right most times and could be configurable for those who don't want 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

Successfully merging this pull request may close these issues.

2 participants