pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.62k stars 518 forks source link

Editor word wrap does not seem to work properly #1056

Closed dvdvideo1234 closed 4 years ago

dvdvideo1234 commented 4 years ago

IDE info:

ZeroBrane Studio (1.70; MobDebug 0.702)
Copyright © 2011-2017 ZeroBrane LLC
Paul Kulchenko
Licensed under the MIT License. 
Based on Estrela Editor
Copyright © 2008-2011 Luxinia DevTeam
Christoph Kubisch, Eike Decker
Licensed under the MIT License. 

Based on wxLua editor
Copyright © 2002-2005 Lomtick Software
J. Winwood, John Labenski
Licensed under wxWindows Library License, v3. 
Built with wxWidgets 3.1.1, wxLua 2.8.12.3 

User configurations

--[[--
  Use this file to specify **User** preferences.
  Review [examples](+D:\LuaIDE\cfg\user-sample.lua) or check [online documentation](http://studio.zerobrane.com/documentation.html) for details.
--]]--

print(package.path)

editor.foldtype = 'box'
editor.smartindent = true
editor.tabwidth = 2
editor.usetabs = false
editor.usewrap = false -- Disable long lines wrapping to the next line

image

pkulchenko commented 4 years ago

@dvdvideo1234, not sure what to tell you. I haven't seen any issues with the wrapping even in the previous versions, but would be great if you could test on 1.90 (instead of 1.70 you are using, as that version is pretty old). Also, how long is that line and what OS are you on? If you can reproduce it on 1.90, I'll check what's going on, but so far I haven't been able to reproduce even on very long lines (x00000 columns wide).

dvdvideo1234 commented 4 years ago

@pkulchenko On it. I will install 1.90. I am on Win7

dvdvideo1234 commented 4 years ago

@pkulchenko

Hello I tested version 1.9 an this is the result ( Same thing ):

ZeroBrane Studio (1.90; MobDebug 0.706)
Copyright © 2011-2020 ZeroBrane LLC
Paul Kulchenko
Licensed under the MIT License. 
Built with wxWidgets 3.1.4, wxLua 3.0.0.8, Scintilla 3.7.2 
Based on Estrela Editor
Copyright © 2008-2011 Luxinia DevTeam
Christoph Kubisch, Eike Decker
Licensed under the MIT License. 

Based on wxLua editor
Copyright © 2002-2005 Lomtick Software
J. Winwood, John Labenski
Licensed under wxWindows Library License, v3. 

image

Am I missing something maybe ?

pkulchenko commented 4 years ago

@dvdvideo1234, how long are these lines? Are any lines being wrapped?

Can you run ide:GetEditor():GetWrapMode() in the console when test.lua is the active editor and copy the result here?

Also, can you take a full screenshot of the wrapped editor (including the right and bottom borders)?

dvdvideo1234 commented 4 years ago

@pkulchenko Full HD 16:9 being 1920:1080 the a line has exactly 559 as

image

pkulchenko commented 4 years ago

@dvdvideo1234, given the response, it looks like the wrapping is not enabled for this editor window. Not sure why, but I'd like to check on two things. What is the value of ide.config.editor.usewrap and ide.config.editor.wrapmode (you can type this into Local Console) and what happens after you execute ide:GetEditor():SetWrapMode(1) in the console? Does it switch to non-wrap mode?

Also, can you try the following patch to see if this fixes the issue:

diff --git a/src/editor/editor.lua b/src/editor/editor.lua
index 060db817..399702a3 100644
--- a/src/editor/editor.lua
+++ b/src/editor/editor.lua
@@ -747,6 +747,7 @@ function CreateEditor(bare)
       end
     end
   else
+    editor:SetWrapMode(wxstc.wxSTC_WRAP_NONE)
     editor:SetScrollWidth(100) -- set default width
     editor:SetScrollWidthTracking(1) -- enable width auto-adjustment
   end

This patch explicitly sets the value (but it should be set by default anyway).

dvdvideo1234 commented 4 years ago

@pkulchenko

Hello, now it works

>>>ide.config.editor.usewrap
   true
>>>ide.config.editor.wrapmode
   1
>>>ide:GetEditor():SetWrapMode(1)
>>>

The request ide:GetEditor():SetWrapMode(1) does change wrapping.

image

C:\Users\DVD\.zbstudio\user.lua: Mixed end-of-line encodings detected. Use 'ide:GetEditor():SetViewEOL(1)' to show line endings and 'ide:GetEditor():ConvertEOLs(ide:GetEditor():GetEOLMode())' to convert them.

In the console I noticed that print(package.path) was erroring... Wonder why. Removed it and now it works. Weird ... Though the interpreter will just print package.path when the IDE loads.

pkulchenko commented 4 years ago

In the console I notices that print(package.path) was erroring... Wonder why. Removed it and now it works.

That was my guess that the config was not executing fully; you should see an error message to that effect in the console. Closing...