mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 02:59:20 +01:00
Update Main.lua
This commit is contained in:
parent
674e7f8843
commit
91a97273d8
@ -77,7 +77,7 @@ local currentScriptDirectory = filesystem.path(system.getCurrentScript())
|
|||||||
local configPath = paths.user.applicationData .. "MineCode IDE/Config9.cfg"
|
local configPath = paths.user.applicationData .. "MineCode IDE/Config9.cfg"
|
||||||
local localization = system.getLocalization(currentScriptDirectory .. "Localizations/")
|
local localization = system.getLocalization(currentScriptDirectory .. "Localizations/")
|
||||||
local findStartFrom
|
local findStartFrom
|
||||||
local clipboard
|
local clipboard = require('Clipboard')
|
||||||
local breakpointLines
|
local breakpointLines
|
||||||
local lastErrorLine
|
local lastErrorLine
|
||||||
local autocompleteDatabase
|
local autocompleteDatabase
|
||||||
@ -970,17 +970,17 @@ local function deleteSelectedData()
|
|||||||
clearSelection()
|
clearSelection()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
print(clipboard)
|
||||||
local function copy()
|
local function copy()
|
||||||
if codeView.selections[1] then
|
if codeView.selections[1] then
|
||||||
if codeView.selections[1].to.line == codeView.selections[1].from.line then
|
if codeView.selections[1].to.line == codeView.selections[1].from.line then
|
||||||
clipboard = { unicode.sub(lines[codeView.selections[1].from.line], codeView.selections[1].from.symbol, codeView.selections[1].to.symbol) }
|
clipboard.copy({ unicode.sub(lines[codeView.selections[1].from.line], codeView.selections[1].from.symbol, codeView.selections[1].to.symbol) })
|
||||||
else
|
else
|
||||||
clipboard = { unicode.sub(lines[codeView.selections[1].from.line], codeView.selections[1].from.symbol, -1) }
|
clipboard.copy({ unicode.sub(lines[codeView.selections[1].from.line], codeView.selections[1].from.symbol, -1) })
|
||||||
for line = codeView.selections[1].from.line + 1, codeView.selections[1].to.line - 1 do
|
for line = codeView.selections[1].from.line + 1, codeView.selections[1].to.line - 1 do
|
||||||
table.insert(clipboard, lines[line])
|
table.insert(clipboard.history[1], lines[line])
|
||||||
end
|
end
|
||||||
table.insert(clipboard, unicode.sub(lines[codeView.selections[1].to.line], 1, codeView.selections[1].to.symbol))
|
table.insert(clipboard.history[1], unicode.sub(lines[codeView.selections[1].to.line], 1, codeView.selections[1].to.symbol))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1320,8 +1320,8 @@ local function createEditOrRightClickMenu(menu)
|
|||||||
copy()
|
copy()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem("⇲", localization.paste, not clipboard, "^V").onTouch = function()
|
menu:addItem("⇲", localization.paste, not clipboard.history[1], "^V").onTouch = function()
|
||||||
paste(clipboard)
|
paste(clipboard.history[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
menu:addSeparator()
|
||||||
@ -1453,8 +1453,8 @@ codeView.eventHandler = function(workspace, object, e1, e2, e3, e4, e5)
|
|||||||
copy()
|
copy()
|
||||||
end
|
end
|
||||||
-- V
|
-- V
|
||||||
elseif e4 == 47 and clipboard then
|
elseif e4 == 47 and clipboard.paste() then
|
||||||
paste(clipboard)
|
paste(clipboard.paste())
|
||||||
-- X
|
-- X
|
||||||
elseif e4 == 45 then
|
elseif e4 == 45 then
|
||||||
if codeView.selections[1] then
|
if codeView.selections[1] then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user