diff --git a/MSVC.md b/MSVC.md index 0d8a127d55124..cb1d495c1bc26 100644 --- a/MSVC.md +++ b/MSVC.md @@ -16,7 +16,7 @@ or download in ZIP and extract to **D:\TBuild\**, rename **tdesktop-master** to ####OpenSSL -Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\Shortcuts\\** folder), go to **D:\\TBuild\\Libraries** and run +Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder), go to **D:\\TBuild\\Libraries** and run git clone https://github.com/openssl/openssl.git cd openssl @@ -89,7 +89,7 @@ or download in ZIP and extract to **D:\TBuild\Libraries\**, rename **libexif-0.6 ####OpenAL Soft, slightly patched -Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\Shortcuts\\** folder), go to **D:\\TBuild\\Libraries** and run +Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder), go to **D:\\TBuild\\Libraries** and run git clone git://repo.or.cz/openal-soft.git git checkout 90349b38 @@ -98,7 +98,7 @@ Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Fi #####Building library * Install [CMake](http://www.cmake.org/) -* Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\Shortcuts\\** folder), go to **D:\TBuild\Libraries\openal-soft\build\** and run +* Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder), go to **D:\TBuild\Libraries\openal-soft\build\** and run cmake -G "Visual Studio 14 2015" -D LIBTYPE:STRING=STATIC -D FORCE_STATIC_VCRT:STRING=ON .. @@ -120,7 +120,7 @@ to have **D:\TBuild\Libraries\opus\win32** ####FFmpeg -Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\Shortcuts\\** folder) and run +Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder) and run git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg cd ffmpeg @@ -132,7 +132,7 @@ http://msys2.github.io/ > Download [msys2-x86_64-20150512.exe](http://sourceforg Download [yasm for Win64](http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe) from http://yasm.tortall.net/Download.html, rename **yasm-1.3.0-win64.exe** to **yasm.exe** and place it to your Visual C++ **bin** directory, like **\\Program Files (x86)\\Microsoft Visual Studio 14\\VC\\bin\\** -Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\Shortcuts\\** folder), go to **D:\\msys64\\** and launch **msys2_shell.bat**, there run +Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder), go to **D:\\msys64\\** and launch **msys2_shell.bat**, there run PATH="/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN:$PATH" @@ -153,7 +153,7 @@ Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Fi ####Qt 5.5.1, slightly patched * Install Python 3.3.2 from https://www.python.org/download/releases/3.3.2 > [**Windows x86 MSI Installer (3.3.2)**](https://www.python.org/ftp/python/3.3.2/python-3.3.2.msi) -* Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\Shortcuts\\** folder) +* Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder) There go to Libraries directory diff --git a/Telegram/SourceFiles/gui/flatinput.cpp b/Telegram/SourceFiles/gui/flatinput.cpp index 098522c818c76..0a05271029b49 100644 --- a/Telegram/SourceFiles/gui/flatinput.cpp +++ b/Telegram/SourceFiles/gui/flatinput.cpp @@ -970,9 +970,17 @@ void InputArea::onDocumentContentsChange(int position, int charsRemoved, int cha QString oldtext(_oldtext); QTextCursor(_inner.document()->docHandle(), 0).joinPreviousEditBlock(); - QTextCursor c(_inner.document()->docHandle(), 0); - c.movePosition(QTextCursor::End); - int pos = c.position(); + if (!position) { // Qt bug workaround https://bugreports.qt.io/browse/QTBUG-49062 + QTextCursor c(_inner.document()->docHandle(), 0); + c.movePosition(QTextCursor::End); + if (position + charsAdded > c.position()) { + int32 toSubstract = position + charsAdded - c.position(); + if (charsRemoved >= toSubstract) { + charsAdded -= toSubstract; + charsRemoved -= toSubstract; + } + } + } _correcting = true; if (_maxLength >= 0) { @@ -1645,9 +1653,17 @@ void InputField::onDocumentContentsChange(int position, int charsRemoved, int ch QString oldtext(_oldtext); QTextCursor(_inner.document()->docHandle(), 0).joinPreviousEditBlock(); - QTextCursor c(_inner.document()->docHandle(), 0); - c.movePosition(QTextCursor::End); - int pos = c.position(); + if (!position) { // Qt bug workaround https://bugreports.qt.io/browse/QTBUG-49062 + QTextCursor c(_inner.document()->docHandle(), 0); + c.movePosition(QTextCursor::End); + if (position + charsAdded > c.position()) { + int32 toSubstract = position + charsAdded - c.position(); + if (charsRemoved >= toSubstract) { + charsAdded -= toSubstract; + charsRemoved -= toSubstract; + } + } + } _correcting = true; if (_maxLength >= 0) {