-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
270 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* refactor(commands): rename LinesDuplicate -> VisualDuplicate | ||
* fix(commands): offset wasn't taken into account by user commands | ||
* feat(selection): put cursor inside selection depending on duplication direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
:LineDuplicate duplicate.txt /*:LineDuplicate* | ||
:VisualDuplicate duplicate.txt /*:VisualDuplicate* | ||
duplicate--configuration duplicate.txt /*duplicate--configuration* | ||
duplicate-api duplicate.txt /*duplicate-api* | ||
duplicate-commands duplicate.txt /*duplicate-commands* | ||
duplicate-examples duplicate.txt /*duplicate-examples* | ||
duplicate-install duplicate.txt /*duplicate-install* | ||
duplicate-keybindings duplicate.txt /*duplicate-keybindings* | ||
duplicate-legendary duplicate.txt /*duplicate-legendary* | ||
duplicate-overview duplicate.txt /*duplicate-overview* | ||
duplicate-table-of-contents duplicate.txt /*duplicate-table-of-contents* | ||
duplicate-update duplicate.txt /*duplicate-update* | ||
duplicate.txt duplicate.txt /*duplicate.txt* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- Created-at...: September 25, 2023 | ||
-- Description..: Range class | ||
--- @module Range | ||
-- Extension class for lines management | ||
-- TODO: [October 14, 2023] Move this to nvim-api.nvim | ||
local M = {} | ||
|
||
--- Small class for duplication | ||
--- @class M.Range | ||
M.Range = { prototype = { ctx = {} } } | ||
M.Range._mt = { | ||
__index = function(table, key) | ||
return table.constructor.prototype[key] | ||
or table.constructor.super | ||
and table.constructor.super.prototype[key] | ||
end, | ||
} | ||
-- LuaFormatter on | ||
|
||
--- Creates new instance static method) | ||
--- @tparam Table containing area | ||
function M.Range:new(posStart, posEnd, config) | ||
local instance = {} | ||
instance.config = config | ||
instance.constructor = self | ||
|
||
instance[1] = posStart | ||
instance[2] = posEnd | ||
|
||
setmetatable(instance, self._mt) | ||
return instance | ||
end | ||
|
||
--- Check if range is on the same line | ||
--- @tparam | ||
--- @treturn boolean | ||
function M.Range.prototype:sameLine () | ||
return self[1][2] == self[2][2] | ||
end | ||
|
||
return M |
Oops, something went wrong.