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

fix(opfunc): fix linewise comment for partial visual selection in single line (Bug#476) #477

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lua/Comment/opfunc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Op.opfunc(motion, cfg, cmode, ctype)
local ctx = {
cmode = cmode,
cmotion = cmotion,
ctype = is_blockx and U.ctype.blockwise or ctype,
ctype = ctype,
range = range,
}

Expand All @@ -62,7 +62,7 @@ function Op.opfunc(motion, cfg, cmode, ctype)
range = range,
}

if motion ~= nil and (is_blockx or ctype == U.ctype.blockwise) then
if motion ~= nil and ctype == U.ctype.blockwise then
ctx.cmode = Op.blockwise(params, is_partial)
else
ctx.cmode = Op.linewise(params)
Expand Down Expand Up @@ -139,7 +139,7 @@ function Op.linewise(param)
local cmode = U.cmode.uncomment

---When commenting multiple line, it is to be expected that indentation should be preserved
---So, When looping over multiple lines we need to store the indentation of the mininum length (except empty line)
---So, When looping over multiple lines we need to store the indentation of the minimum length (except empty line)
---Which will be used to semantically comment rest of the lines
local min_indent, tabbed = -1, false

Expand Down