Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find & Replace is often off by 1 line #129171

Closed
af4jm opened this issue Jul 22, 2021 · 5 comments
Closed

Find & Replace is often off by 1 line #129171

af4jm opened this issue Jul 22, 2021 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@af4jm
Copy link

af4jm commented Jul 22, 2021

Issue Type: Bug

screen shot pretty much says it all... when using find in files, find & replace is often off by a line... only work-arounds are go file by file, or switch to another editor for find & replace

image

this one has been around for at least a year, so it's not a recent regression

VS Code version: Code 1.58.2 (c3f1263, 2021-07-14T22:10:15.214Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 x 1800)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.89GB (19.87GB free)
Process Argv --file-uri file:///c%3A/src/AF4JM.code-workspace --crash-reporter-id 06338080-eec2-498d-98e0-cf3111dc1cde
Screen Reader no
VM 0%
Extensions (112)
Extension Author (truncated) Version
html-snippets abu 0.2.1
vscode-icalendar af4 1.0.1
vscode-m3u af4 1.0.0
vscode-caniuse aga 0.5.0
Bookmarks ale 13.1.0
rtf ale 2.3.0
vscode-sqlite ale 0.13.0
swagger-viewer Arj 3.1.2
vscode-browser-preview auc 0.7.1
armview ben 0.4.5
markdown-checkbox bie 0.1.3
markdown-emoji bie 0.1.0
markdown-footnotes bie 0.0.7
markdown-mermaid bie 1.10.0
markdown-yaml-preamble bie 0.0.4
vscode-tldr bmu 1.0.0
mermaid-markdown-syntax-highlighting bpr 1.2.2
npm-intellisense chr 1.4.0
gitignore cod 0.7.0
disableligatures Coe 0.0.10
vscode-markdownlint Dav 0.42.1
jshint dba 0.11.0
vscode-eslint dba 2.1.23
dendron-snippet-maker den 0.1.6
rushcore Dev 1.0.2
rushnav Dev 1.0.2
githistory don 0.6.17
xml Dot 2.5.1
escaping-characters drp 1.0.0
vscode-babel-coloring dza 0.0.4
gitlens eam 11.6.0
EditorConfig Edi 0.16.4
vscode-npm-script eg2 0.3.22
git-project-manager fel 1.7.1
scriptcsRunner fil 0.1.0
vscode-firefox-debug fir 2.9.4
vscode-npm fkn 3.3.0
shell-format fox 7.1.0
macros ged 1.2.1
matlab Gim 2.0.1
vscode-pull-request-github Git 0.28.0
gc-excelviewer Gra 3.0.42
beautify Hoo 1.5.0
rest-client hum 0.24.5
r Iku 2.1.0
path-autocomplete ion 1.17.1
mediawiki jak 2.1.0
anki jas 1.2.0
nuget-reverse-package-search jes 0.1.68
vscode-nuget-package-manager jmr 1.1.6
vscode-peacock joh 3.9.1
gpg jva 0.1.2
docomment k-- 0.1.20
vscode-liquid-snippets kil 2.0.3
gnuplot mam 1.0.5
markdown-shortcuts mdi 0.12.0
openapi-lint mer 1.2.0
HTMLHint mka 0.10.0
azure-pipelines ms- 1.188.1
vscode-azureappservice ms- 0.22.0
vscode-azurefunctions ms- 1.4.1
vscode-azureresourcegroups ms- 0.4.0
vscode-azurestorage ms- 0.12.1
vscode-azurevirtualmachines ms- 0.4.0
vscode-bicep ms- 0.4.451
vscode-cosmosdb ms- 0.17.0
csharp ms- 1.23.13
vscode-dotnet-runtime ms- 1.2.0
mssql ms- 1.10.1
anaconda-extension-pack ms- 1.0.1
python ms- 2021.7.1053846006
vscode-pylance ms- 2021.7.4
jupyter ms- 2021.8.1054968649
vscode-ai-remote ms- 0.4.0
remote-containers ms- 0.187.1
remote-ssh ms- 0.65.7
remote-ssh-edit ms- 0.65.7
vscode-remote-extensionpack ms- 0.21.0
azure-account ms- 0.9.8
azurecli ms- 0.5.0
mono-debug ms- 0.16.2
powershell ms- 2021.6.2
vscode-node-azure-pack ms- 0.2.1
vscode-typescript-tslint-plugin ms- 1.3.3
azurerm-vscode-tools msa 0.15.2
debugger-for-chrome msj 4.12.12
debugger-for-edge msj 1.0.15
language-liquid nei 0.1.1
vscode-commons red 0.0.6
vscode-yaml red 0.21.1
kuskus-kusto-language-server ros 1.0.1
kuskus-kusto-syntax-highlighting ros 1.1.8
toggle-case rya 1.0.2
vscode-hexdump sle 1.8.1
vscode-zipexplorer sle 0.3.1
timestamp-converter Sta 0.0.1
addDocComments ste 0.0.8
code-spell-checker str 1.10.2
code-spell-checker-greek str 0.1.7
code-spell-checker-hebrew str 0.1.6
code-spell-checker-medical-terms str 1.0.10
code-spell-checker-spanish str 1.0.8
msbuild-project-tools tin 0.3.15
shell-launcher Tyr 0.4.1
vscodeintellicode Vis 1.2.14
nanoid-generator vk- 0.1.2
vscode-icons vsc 11.5.0
markdown-wiki-links-preview-vanilla af4 1.0.0
highlight-bad-chars wen 0.0.3
JavaScriptSnippets xab 1.8.0
markdown-all-in-one yzh 3.4.0
t4-support zbe 0.5.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspyt653:30270858
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30321513
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255:30340121
vscod805cf:30301675
pythonvspyt200:30340761
vscextlang:30333561
binariesv615:30325510
vsccppwt:30329788
bridge0708:30335490

@roblourens
Copy link
Member

Are there any bare CR characters, not next to an LF character, in the files where this happens? If so it would work again if you change the file and save it in vscode.

If that's not it, can you share the file in which it happens so I can try to repro?

@roblourens roblourens added the info-needed Issue requires more information from poster label Jul 22, 2021
@af4jm
Copy link
Author

af4jm commented Jul 22, 2021

interesting... I did notice that if I edit the file, everything shifts to where it should be

I'll try setting core.autocrlf and see what happens... after I make sure my small images are marked binary in gitattributes, so I don't corrupt them

I do use this repo on iOS & Droid as well, although rarely edit over there so it's likely not what caused this

@roblourens
Copy link
Member

roblourens commented Jul 23, 2021

A bare CR character is not a valid line ending on any modern OS, but sometimes different tools will end up putting them in files anyway.

It's a known issue that our search tool is confused by these. #48063

@af4jm
Copy link
Author

af4jm commented Jul 25, 2021

so I added *.md diff eol=auto text to .gitattributes, and git removed a blank line from below the first heading in several files... since then I'm no longer able to reproduce (and it seemed hit-or-miss prior to that, and only with MD files), so I guess that was it... the behavior in my screenshot still seems odd to me, but as long as global find & replace no longer means jumping over to another editor or writing a PowerShell script, I'm happy!

@af4jm af4jm closed this as completed Jul 25, 2021
@roblourens
Copy link
Member

Most likely there is a weird CR character in the file, and now git is normalizing it for you. Glad it works for you now!

@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants