From d818e874dd7eb340948fc77afd46a410b6bd0a99 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sun, 22 Jan 2017 11:14:05 +0300 Subject: [PATCH] aefaf --- .DS_Store | Bin 18436 -> 18436 bytes Applications.txt | 2 +- Applications/.DS_Store | Bin 79876 -> 79876 bytes Applications/MineCodeIDE/MineCodeIDE.lua | 24 +++++++++++++++-------- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.DS_Store b/.DS_Store index 354ec1468dd00700ca18de06bdf924fd57968e39..62a0e2acce7adbf32ef88b4ed4a695013c3dde7d 100644 GIT binary patch delta 22 ecmZpfz}PZ@al=l<$$u?9C%dRfZkAShsR{sUxd_<+ delta 22 ecmZpfz}PZ@al=l<$@9cKC%dRfZkAShsR{sO#0Xaa diff --git a/Applications.txt b/Applications.txt index 43f01b09..ee7f8ecb 100644 --- a/Applications.txt +++ b/Applications.txt @@ -517,7 +517,7 @@ icon="IgorTimofeev/OpenComputers/master/Applications/MineCodeIDE/Icon.pic", createShortcut="dock", forceDownload=true, - version=1.50, + version=1.51, resources={ { name="Localization/Russian.lang", diff --git a/Applications/.DS_Store b/Applications/.DS_Store index e28251d111935bc600b712b87730b8847a733b56..ba31b42078697a8d3e7207e03b438d59161dfc60 100644 GIT binary patch delta 23 fcmZqqz|!)8Wy6Zy9Hxe*ItoS>rkgkH4ygeEcIpX$ delta 22 ecmZqqz|!)8Wy6ZyldHr%CyVS6-^{V+Pc;C3H451P diff --git a/Applications/MineCodeIDE/MineCodeIDE.lua b/Applications/MineCodeIDE/MineCodeIDE.lua index bf3528de..df66b7a2 100755 --- a/Applications/MineCodeIDE/MineCodeIDE.lua +++ b/Applications/MineCodeIDE/MineCodeIDE.lua @@ -377,15 +377,23 @@ local function isClickedOnCodeArea(x, y) end local function moveCursor(symbolOffset, lineOffset) - local newSymbol, newLine = cursor.position.symbol + symbolOffset, cursor.position.line + lineOffset - - if symbolOffset < 0 and newSymbol < 1 then - newLine, newSymbol = newLine - 1, math.huge - elseif symbolOffset > 0 and newSymbol > unicode.len(mainWindow.codeView.lines[newLine] or "") + 1 then - newLine, newSymbol = newLine + 1, 1 - end + if mainWindow.codeView.selections[1] then + if symbolOffset < 0 or lineOffset < 0 then + setCursorPositionAndClearSelection(mainWindow.codeView.selections[1].from.symbol, mainWindow.codeView.selections[1].from.line) + else + setCursorPositionAndClearSelection(mainWindow.codeView.selections[1].to.symbol, mainWindow.codeView.selections[1].to.line) + end + else + local newSymbol, newLine = cursor.position.symbol + symbolOffset, cursor.position.line + lineOffset + + if symbolOffset < 0 and newSymbol < 1 then + newLine, newSymbol = newLine - 1, math.huge + elseif symbolOffset > 0 and newSymbol > unicode.len(mainWindow.codeView.lines[newLine] or "") + 1 then + newLine, newSymbol = newLine + 1, 1 + end - setCursorPositionAndClearSelection(newSymbol, newLine) + setCursorPositionAndClearSelection(newSymbol, newLine) + end end local function setCursorPositionToHome()