add a __tostring method to every object (#1534)
* added a stupid __tostring to every object * moved every __tostring to just after the :extend() call --------- Co-authored-by: Adam <adamdharrison@gmail.com> (cherry picked from commit 880e7f1fa1521cdf176f44627a27c901e187058e)
This commit is contained in:
@@ -10,6 +10,8 @@ local View = require "core.view"
|
||||
---@field super core.doc
|
||||
local SingleLineDoc = Doc:extend()
|
||||
|
||||
function SingleLineDoc:__tostring() return "SingleLineDoc" end
|
||||
|
||||
function SingleLineDoc:insert(line, col, text)
|
||||
SingleLineDoc.super.insert(self, line, col, text:gsub("\n", ""))
|
||||
end
|
||||
@@ -18,6 +20,8 @@ end
|
||||
---@field super core.docview
|
||||
local CommandView = DocView:extend()
|
||||
|
||||
function CommandView:__tostring() return "CommandView" end
|
||||
|
||||
CommandView.context = "application"
|
||||
|
||||
local max_suggestions = 10
|
||||
@@ -391,5 +395,4 @@ function CommandView:draw()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return CommandView
|
||||
|
||||
Reference in New Issue
Block a user