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

<C-d>, etc. not working at beginning or end of buffer in 1.11.2 #4179

Closed
gallois opened this issue Oct 15, 2019 · 21 comments
Closed

<C-d>, etc. not working at beginning or end of buffer in 1.11.2 #4179

gallois opened this issue Oct 15, 2019 · 21 comments
Labels

Comments

@gallois
Copy link

gallois commented Oct 15, 2019

After updating to 1.11.2 if I try to C-f, C-b, C-d etc. at the beginning or the end of the buffer, i.e. the first or the last line of the document is visible in the screen, the motions will not work, if I manually scroll the screen so that they aren't visible any more, I can use the commands as expected.

I've downgraded the extension to 1.10.2 and it seems to work fine. I was able to reproduce by updating it again.

Let me know if there is any more information I can provide to help investigate.

@J-Fields J-Fields changed the title extension.vim_ctrl+ not working at beginning or end of buffer in 1.11.2 <C-d>, etc. not working at beginning or end of buffer in 1.11.2 Oct 15, 2019
@J-Fields
Copy link
Member

That's very strange - this is almost certainly a result of 2237394, which fixed the very issue you're describing for me (though there are still a few edge cases in the implementation which I've been meaning on going back to).

Can you please show your settings?

@gallois
Copy link
Author

gallois commented Oct 15, 2019

Interestingly enough, <C-e> seems to work ¯\_(ツ)_/¯

Here are my settings, I've removed some settings that are completely unrelated

{
    "editor.cursorBlinking": "solid",
    "terminal.integrated.macOptionIsMeta": true,
    "editor.smoothScrolling": true,
    "vim.leader": "<space>",
    "vim.useCtrlKeys": true,
    "vim.incsearch": true,
    "vim.hlsearch": true,
    "vim.easymotion": true,
    "vim.camelCaseMotion.enable": true,
    "vim.easymotionMarkerFontFamily": "Monaco",
    "vim.easymotionMarkerBackgroundColor": "#3C6478",
    "vim.easymotionMarkerHeight": 18,
    "vim.easymotionMarkerWidthPerChar": 10,
    "vim.handleKeys": {
        "<C-n>": false,
        "<C-p>": false,
        "<C-a>": false,
    },
    "vim.useSystemClipboard": true,
    "vim.enableNeovim": true,
    "vim.neovimPath": "/usr/local/bin/nvim",
    "files.autoSave": "off",
    "editor.rulers": [
        80
    ],
    "window.zoomLevel": 0,
    "editor.lineHeight": 16,
    "editor.snippetSuggestions": "top",
    "editor.renderWhitespace": "all",
    "files.trimTrailingWhitespace": true,
    "workbench.quickOpen.closeOnFocusLost": false,
    "workbench.tree.indent": 16,
    "editor.acceptSuggestionOnEnter": "off",
}

edit: fixing markdown

@blackrobot
Copy link

I'm having the same issue. Near the beginning of a buffer <C-f> does nothing, and near the end of a buffer <C-b> does nothing. Here are my relevant settings:

Click to expand settings
{
  "editor.fontLigatures": true,
  "editor.renderWhitespace": "selection",
  "editor.lineNumbers": "relative",
  "editor.rulers": [88, 120],
  "editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": false,
  },
  "editor.occurrencesHighlight": false,
  "editor.renderLineHighlight": "all",
  "editor.renderControlCharacters": true,
  "editor.roundedSelection": true,
  "editor.minimap.enabled": false,
  "editor.smoothScrolling": true,
  "editor.overviewRulerBorder": true,
  "editor.tabCompletion": "on",
  "editor.snippetSuggestions": "bottom",

  "vim.leader": ",",
  "vim.useSystemClipboard": true,
  "vim.hlsearch": true,
  "vim.visualstar": true,
  "vim.foldfix": false,
  "vim.easymotion": true,
  "vim.showmodename": true,
  "vim.statusBarColorControl": false,
  "vim.cursorStylePerMode.normal": "block",
  "vim.cursorStylePerMode.insert": "line",
  "vim.cursorStylePerMode.replace": "underline",
  "vim.cursorStylePerMode.visual": "block-outline",
  "vim.cursorStylePerMode.visualline": "block-outline",
  "vim.cursorStylePerMode.visualblock": "block-outline",
  "vim.enableNeovim": true,
  "vim.neovimPath": "/usr/local/bin/nvim",
  "vim.insertModeKeyBindingsNonRecursive": [
    { "before": ["<C-l>"], "commands": [":nohl", "closeFindWidget"] },
  ],
  "vim.normalModeKeyBindingsNonRecursive": [
    { "before": ["<C-l>"], "after": ["<Esc>"], "commands": [":nohl", "closeFindWidget"] },
    { "before": ["<C-w>", "H"], "commands": ["workbench.action.moveEditorToLeftGroup"] },
    { "before": ["<C-w>", "L"], "commands": ["workbench.action.moveEditorToRightGroup"] },
    { "before": ["<C-w>", "K"], "commands": ["workbench.action.moveEditorToAboveGroup"] },
    { "before": ["<C-w>", "J"], "commands": ["workbench.action.moveEditorToBelowGroup"] },
    { "before": ["<C-w>", "\\"], "commands": ["workbench.action.joinAllGroups"] },
    { "before": ["<leader>", "b"], "commands": ["breadcrumbs.toggle"] },
    { "before": ["<leader>", "t"], "commands": ["workbench.action.tasks.runTask"] },
    { "before": ["<leader>", "="], "commands": ["workbench.action.minimizeOtherEditors"] },
    { "before": ["g", "t"], "commands": ["workbench.action.terminal.focus"] },
    { "before": ["<leader>", "o"], "commands": ["outline.focus"] },
    { "before": ["u"], "commands": ["undo"] },
    { "before": ["<C-r>"], "commands": ["redo"] },
  ],
  "vim.visualModeKeyBindingsNonRecursive": [
    { "before": ["<C-l>"], "after": ["<Esc>"], "commands": [":nohl", "closeFindWidget"] },
    { "before": [">"], "commands": ["editor.action.indentLines"] },
    { "before": ["<"], "commands": ["editor.action.outdentLines"] },
  ],
  "vim.highlightedyank.enable": true,
  "vim.highlightedyank.color": "#c2185b",

  "workbench.useExperimentalGridLayout": true,
}

You can see my full settings file here:
https://github.com/blackrobot/dotfiles/blob/master/vs-code/settings.json

@spacepluk
Copy link

Same here:

settings.json

{
    "editor.codeLens": true,
    "workbench.colorTheme": "Monokai Pro",
    "workbench.iconTheme": "Monokai Pro Icons",
    "workbench.activityBar.visible": false,
    "window.zoomLevel": -1,
    "window.menuBarVisibility": "toggle",
    "zenMode.centerLayout": false,
    "editor.tabSize": 2,
    "editor.insertSpaces": true,
    "editor.minimap.enabled": false,
    "diffEditor.renderSideBySide": false,
    "gitlens.advanced.messages": {
        "suppressShowKeyBindingsNotice": true
    },
    "files.associations": {
        "*.qrc": "xml",
        "*.{unity,asset,meta}": "yaml"
    },
    "terminal.integrated.commandsToSkipShell": [
        "-workbench.action.terminal.focusFindWidget",
        "-workbench.action.quickOpen",
    ],
    "vim.leader": "<space>",
    "vim.foldfix": true,
    "vim.sneak": true,
    "vim.statusBarColorControl": false,
    "vim.disableExtension": false,
    "vim.hlsearch": true,
    "vim.handleKeys": {
        "<C-b>": false,
        "<C-f>": true
    },
    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before":["leader", "leader"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.showCommands"
                }
            ]
        },
        {
            "before":["leader", "e", "e"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.view.explorer"
                }
            ]
        }, 
        {
            "before":["leader", "f", "f"],
            "after": [],
            "commands": [
               {
                    "command": "workbench.view.search"
                }
            ]
        }, 
        {
            "before":["leader", "g", "s"],
            "commands": [
                {
                    "command": "workbench.view.scm"
                }
            ]
        },
        {
            "before":["leader", "g", "l"],
            "commands": [
                {
                    "command": "gitlens.showGitExplorer"
                }
            ]
        },
        {
            "before":["leader", "g", "d"],
            "commands": [
                {
                    "command": "git.openChange"
                }
            ]
        },
        {
            "before":["leader", "d", "d"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.view.debug"
                }
            ]
        },
        {
            "before":["leader", "x", "x"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.view.extensions"
                }
            ]
        },
        {
            "before":["leader", "k"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.keepEditor"
                }
            ]
        },
        {
            "before":["<C-w>", "H"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.moveEditorToLeftGroup"
                }
            ]
        },
        {
            "before":["<C-w>", "J"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.moveEditorToBelowGroup"
                }
            ]
        },
        {
            "before":["<C-w>", "K"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.moveEditorToAboveGroup"
                }
            ]
        },
        {
            "before":["<C-w>", "L"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.moveEditorToRightGroup"
                }
            ]
        },
        {
            "before":["<C-w>", "s"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.splitEditorDown"
                }
            ]
        },
        {
            "before":["leader", "b", "d"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.closeActiveEditor"
                }
            ]
        },
        {
            "before":["]", "q"],
            "after": [],
            "commands": [
                {
                    "command": "editor.action.marker.next"
                }
            ]
        },
        {
            "before":["[", "q"],
            "after": [],
            "commands": [
                {
                    "command": "editor.action.marker.previous"
                }
            ]
        },
        {
            "before":["]", "c"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.editor.nextChange"
                },
                {
                    "command": "workbench.action.compareEditor.nextChange"
                }
            ]
        },
        {
            "before":["[", "c"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.editor.previousChange"
                },
                {
                    "command": "workbench.action.compareEditor.previousChange"
                }
            ]
        }
    ],
    "gitlens.views.fileHistory.enabled": true,
    "gitlens.views.lineHistory.enabled": true,
    "editor.lineHeight": 17,
    "workbench.colorCustomizations": {
        "activityBarBadge.background": "#FF7042",
        "list.activeSelectionForeground": "#FF7042",
        "list.inactiveSelectionForeground": "#FF7042",
        "list.highlightForeground": "#FF7042",
        "scrollbarSlider.activeBackground": "#FF704250",
        "editorSuggestWidget.highlightForeground": "#FF7042",
        "textLink.foreground": "#FF7042",
        "progressBar.background": "#FF7042",
        "pickerGroup.foreground": "#FF7042",
        "tab.activeBorder": "#FF7042",
        "notificationLink.foreground": "#FF7042",
        "editorWidget.resizeBorder": "#FF7042",
        "editorWidget.border": "#FF7042",
        "settings.modifiedItemIndicator": "#FF7042",
        "settings.headerForeground": "#FF7042",
        "panelTitle.activeBorder": "#FF7042",
        "breadcrumb.activeSelectionForeground": "#FF7042",
        "menu.selectionForeground": "#FF7042",
        "menubar.selectionForeground": "#FF7042",
    },
    "cmake.configureOnOpen": false,
    "workbench.sideBar.location": "left",
    "toggle.iconEnabled": false,
    "editor.acceptSuggestionOnCommitCharacter": false,
    "[cpp]": {
        "editor.defaultFormatter": "ms-vscode.cpptools"
    },
    "platformio-ide.disablePIOHomeStartup": true,
    "editor.smoothScrolling": true,
    "editor.fontFamily": "'MesloLGS Nerd Font', Menlo, Monaco, 'Courier New', monospace",
    "diffEditor.ignoreTrimWhitespace": true,
}

keybindings.json

[
 {
      "key": "alt+left",
      "command": "workbench.action.navigateBack"
  },
  {
      "key": "ctrl+alt+-",
      "command": "-workbench.action.navigateBack"
  },
  {
      "key": "alt+right",
      "command": "workbench.action.navigateForward"
  },
  {
      "key": "ctrl+shift+-",
      "command": "-workbench.action.navigateForward"
  },
  {
      "key": "cmd+j",
      "command": "workbench.action.nextEditor",
      "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
  },
  {
      "key": "cmd+k",
      "command": "workbench.action.previousEditor",
      "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
  },
  {
      "key": "ctrl+n",
      "command": "workbench.action.quickOpenNavigateNext",
      "when": "inQuickOpen"
  },
  {
      "key": "ctrl+p",
      "command": "workbench.action.quickOpenNavigatePrevious",
      "when": "inQuickOpen"
  },
  {
      "key": "ctrl+h",
      "command": "workbench.action.navigateLeft"
  },
  {
      "key": "ctrl+j",
      "command": "workbench.action.navigateDown"
  },
  {
      "key": "ctrl+k",
      "command": "workbench.action.navigateUp"
  },
  {
      "key": "ctrl+k",
      "command": "workbench.action.focusActiveEditorGroup",
      "when": "terminalFocus"
  },
  {
      "key": "ctrl+l",
      "command": "workbench.action.navigateRight"
  },
  {
      "key": "shift+alt+h",
      "command": "-gitlens.showQuickRepoHistory",
      "when": "gitlens:enabled && gitlens:keymap == 'alternate'"
  },
  {
      "key": "d p",
      "command": "git.stageSelectedRanges",
      "when": "isInDiffEditor && vim.active && !inDebugRepl && vim.mode != 'Insert'"
  },
  {
      "key": "d o",
      "command": "git.unstageSelectedRanges",
      "when": "isInDiffEditor && vim.active && !inDebugRepl && vim.mode != 'Insert'"
  },
  {
      "key": "ctrl+cmd+o",
      "command": "workbench.action.toggleMaximizedPanel"
},
{
    "key": "cmd+1",
    "command": "-workbench.action.focusFirstEditorGroup"
},
{
    "key": "cmd+2",
    "command": "-workbench.action.focusSecondEditorGroup"
},
{
    "key": "cmd+3",
    "command": "-workbench.action.focusThirdEditorGroup"
},
{
    "key": "cmd+4",
    "command": "-workbench.action.focusFourthEditorGroup"
},
{
    "key": "cmd+5",
    "command": "-workbench.action.focusFifthEditorGroup"
},
{
    "key": "cmd+6",
    "command": "-workbench.action.focusSixthEditorGroup"
},
{
    "key": "cmd+7",
    "command": "-workbench.action.focusSeventhEditorGroup"
},
{
    "key": "cmd+8",
    "command": "-workbench.action.focusEighthEditorGroup"
},
{
    "key": "cmd+9",
    "command": "-workbench.action.lastEditorInGroup"
},
{
    "key": "ctrl+1",
    "command": "-workbench.action.openEditorAtIndex1"
},
{
    "key": "ctrl+2",
    "command": "-workbench.action.openEditorAtIndex2"
},
{
    "key": "ctrl+3",
    "command": "-workbench.action.openEditorAtIndex3"
},
{
    "key": "ctrl+4",
    "command": "-workbench.action.openEditorAtIndex4"
},
{
    "key": "ctrl+5",
    "command": "-workbench.action.openEditorAtIndex5"
},
{
    "key": "ctrl+6",
    "command": "-workbench.action.openEditorAtIndex6"
},
{
    "key": "ctrl+7",
    "command": "-workbench.action.openEditorAtIndex7"
},
{
    "key": "ctrl+8",
    "command": "-workbench.action.openEditorAtIndex8"
},
{
    "key": "ctrl+9",
    "command": "-workbench.action.lastEditorInGroup"
},
{
    "key": "cmd+1",
    "command": "workbench.action.openEditorAtIndex1"
},
{
    "key": "cmd+2",
    "command": "workbench.action.openEditorAtIndex2"
},
{
    "key": "cmd+3",
    "command": "workbench.action.openEditorAtIndex3"
},
{
    "key": "cmd+4",
    "command": "workbench.action.openEditorAtIndex4"
},
{
    "key": "cmd+5",
    "command": "workbench.action.openEditorAtIndex5"
},
{
    "key": "cmd+6",
    "command": "workbench.action.openEditorAtIndex6"
},
{
    "key": "cmd+7",
    "command": "workbench.action.openEditorAtIndex7"
},
{
    "key": "cmd+8",
    "command": "workbench.action.openEditorAtIndex8"
},
{
    "key": "cmd+9",
    "command": "workbench.action.lastEditorInGroup"
},
{
    "key": "ctrl+d",
    "command": "-deleteRight",
    "when": "textInputFocus && !editorReadonly"
},
{
    "key": "ctrl+d",
    "command": "-list.focusPageDown",
    "when": "listFocus && !inputFocus"
},
{
    "key": "ctrl+u",
    "command": "-list.focusPageUp",
    "when": "listFocus && !inputFocus"
},
]

@yathi
Copy link

yathi commented Oct 16, 2019

Same here! I also turned on handlekeys true for <C-d> but it still doesn't work.

@eastwood
Copy link
Contributor

Similar issue:

    "vim.leader": "<space>",
    "vim.insertModeKeyBindings": [{
    "before": [ "j", "k" ],
        "after": [ "<Esc>" ]
    }],
    "vim.normalModeKeyBindingsNonRecursive": [{
        "before": ["leader", "t"],
        "commands": ["workbench.action.tasks.runTask"]
    }, {
        "before": ["leader", "f", "s"],
        "commands": ["workbench.action.files.save"]
    }, {
        "before": ["leader", "h"],
        "commands": ["workbench.action.focusPreviousGroup"]
    }, {
        "before": ["leader", "l"],
        "commands": ["workbench.action.focusNextGroup"]
    }],
    "vim.useCtrlKeys": true,
    "vim.useSystemClipboard": true,

Hitting C-f always goes to the first char on the line

@J-Fields
Copy link
Member

@eastwood this is how vim behaves; it's expected default behavior. If you want the cursor's column to stay consistent, set vim.startofline to false.

@JavierPDev
Copy link

JavierPDev commented Oct 17, 2019

Also happening for me

settings.json
{
    "workbench.editor.enablePreviewFromQuickOpen": false,
    "files.hotExit": "off",
    "editor.fontSize": 16,
    "editor.tabSize": 2,
    "editor.wordWrap": "on",
    "editor.fontFamily": "Ubuntu Mono derivative Powerline",
    "terminal.integrated.fontFamily": "Ubuntu Mono derivative Powerline",
    "editor.tabCompletion": true,
    "editor.snippetSuggestions": "top",
    "editor.smoothScrolling": true,
    "editor.rulers": [80],
    "vim.easymotion": true,
    "vim.incsearch": true,
    "vim.useSystemClipboard": true,
    "vim.useCtrlKeys": true,
    "vim.hlsearch": true,
    "vim.insertModeKeyBindings": [
        {
            "before": ["j","j"],
            "after": ["<Esc>"]
        }
    ],
    "vim.normalModeKeyBindings": [
        {
            "before": ["leader", "w"],
            "after": ["leader", "leader", "w"]
        },
        {
            "before": ["leader", "e"],
            "after": ["leader", "leader", "e"]
        },
        {
            "before": ["leader", "b"],
            "after": ["leader", "leader", "b"]
        },
        {
            "before": ["leader", "j"],
            "after": ["leader", "leader", "j"]
        },
        {
            "before": ["leader", "k"],
            "after": ["leader", "leader", "k"]
        },
        {
            "before": ["leader", "f"],
            "after": ["leader", "leader", "f"]
        },
        {
            "before": ["leader", "F"],
            "after": ["leader", "leader", "F"]
        },
    ],
    "vim.leader": "<space>",
    "keyboard.dispatch": "keyCode",
    "vim.easymotionMarkerForegroundColorOneChar": "white",
    "vim.easymotionMarkerForegroundColorTwoChar": "white",
    "vim.easymotionMarkerFontSize": "16",
    "vim.easymotionMarkerFontWeight": "bold",
    "vim.easymotionMarkerFontFamily": "Ubuntu Mono",
    "vim.handleKeys": {
        "<C-w>": false,
        "<C-d>": true,
        "<C-f>": true,
        "<C-b>": true
    },
    "window.zoomLevel": 0,
    "files.exclude": {
        "**/node_modules": true,
        "**/.bower-*": true,
        "**/bower_components": true
    },
    "window.menuBarVisibility": "toggle",
    "editor.multiCursorModifier": "ctrlCmd",
    "php.validate.enable": true,
    "php.executablePath": "/usr/bin/php",
    "php.validate.run": "onType",
    "workbench.startupEditor": "newUntitledFile",
    "explorer.openEditors.visible": 0,
    "explorer.autoReveal": false,
    "git.checkoutType": "local",
    // "git.autorefresh": false,
    // "git.autofetch": false,
    "window.title": "${rootName}${separator}${dirty}${activeEditorMedium}${separator}${appName}",
    "explorer.confirmDelete": false,
    "gitlens.advanced.messages": {
        "suppressCommitHasNoPreviousCommitWarning": false,
        "suppressCommitNotFoundWarning": false,
        "suppressFileNotUnderSourceControlWarning": false,
        "suppressGitVersionWarning": false,
        "suppressLineUncommittedWarning": false,
        "suppressNoRepositoryWarning": false,
        "suppressResultsExplorerNotice": false,
        "suppressShowKeyBindingsNotice": true,
        "suppressUpdateNotice": true,
        "suppressWelcomeNotice": false
    },
    "workbench.colorTheme": "Monokai Dimmed",
    "git.autofetch": true,
    "git.confirmSync": false,
    "editor.minimap.enabled": true,
    "gitlens.keymap": "alternate",
    "gitlens.mode.active": "review",
    "gitlens.gitExplorer.location": "explorer",
    "editor.cursorBlinking": "smooth",
    "extensions.ignoreRecommendations": false,
    "breadcrumbs.enabled": true,
    "shellcheck.disableVersionCheck": true,
    "php.suggest.basic": false,
    "gitlens.advanced.repositorySearchDepth": 0,
    "workbench.editor.highlightModifiedTabs": true,
    "window.titleBarStyle": "native",
    "gitlens.views.repositories.location": "explorer",
    "gitlens.views.repositories.files.layout": "list",
    "workbench.colorCustomizations": {
        "peekViewEditor.background": "#4b595e00",
        "peekViewEditor.matchHighlightBackground": "#4b595e00"
    },
    "emmet.includeLanguages": { 
        "javascript": "javascriptreact", 
        "jsx-sublime-babel-tags": "javascriptreact"
    },
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",

    "editor.minimap.renderCharacters": false,
    "editor.minimap.maxColumn": 200,
    "editor.minimap.showSlider": "always",
    "window.newWindowDimensions": "maximized",
    "scm.defaultViewMode": "list",
    "diffEditor.renderSideBySide": false,
    // "php.memoryLimit": "512M"
}

@blackrobot
Copy link

blackrobot commented Oct 17, 2019

this is how vim behaves; it's expected default behavior. If you want the cursor's column to stay consistent, set vim.startofline to false.

@J-Fields: I think what @eastwood is saying is that typing <C-f> moves the cursor to the first character, but stays on the same line instead of scrolling down. The expected behavior is that typing <C-f> scrolls the window one page down.

@eastwood
Copy link
Contributor

Thanks for pointing out the ambiguity, given the context of the ticket, I figured it was implied. Yes @blackrobot is right, C-f doesn't enact "page down" anymore, like it should. It always and only goes to the first character of the current line

@J-Fields
Copy link
Member

@blackrobot @eastwood Ah I see - yeah, this is definitely a bug 🙂

I'll probably have an opportunity this weekend to take a closer look at this. Apologies again for the breakage.

@J-Fields
Copy link
Member

Would someone mind recording a video and showing me? I'm still having trouble reproducing.

@spacepluk
Copy link

There you go. Not the best quality but I hope it helps:

Alt text

@J-Fields
Copy link
Member

J-Fields commented Oct 21, 2019

Hey all - I made some simplifying changes in db9d99c, including a fix to an edge case at the top/bottom of the file.

I still can't reproduce the exact issue you're seeing - if someone could install master locally and let me know if this is still a problem, I'd really appreciate it.

Also: if it's still not working, try setting vim.scroll to a value other than 0 and let me know if that changes anything.

@YanikCeulemans
Copy link

YanikCeulemans commented Oct 21, 2019

Hey, I recorded a small screencast of the extension on the master branch showing that the scrolling issue seems to be solved.

However, when you have virtual scroll space enabled and the last line of the file is at the top of your screen, using <C-u> to scroll half a screen up only seems to be scrolling 1 line up as you can see in the video. I don't know if this might be related.

Another issue that I found which can be seen at the end of the video, when scrolling back up to the top of the file using <C-u>, the cursor seems to stop wherever it ended up when the scroll bar reaches the top of the file. If I'm not mistaken, the behaviour used to be that the cursor would continue going up all the way to the first line as long as you kept using <C-u> (which also appears to be the behaviour in Vim).

https://youtu.be/Ea8gsHaXw4k

@J-Fields
Copy link
Member

J-Fields commented Oct 21, 2019

Hey, I recorded a small screencast of the extension on the master branch showing that the scrolling issue seems to be solved.

Thanks! Glad to see it.

However, when you have virtual scroll space enabled and the last line of the file is at the top of your screen, using to scroll half a screen up only seems to be scrolling 1 line up as you can see in the video. I don't know if this might be related.

Yeah, I'm aware of this and actually don't think it's fixable with the current VSCode API. The reason is that the best info we have on "how big a page is" is using the visible ranges, but this can be only a single line when using virtual space. If you want to use virtual space, I'd recommend setting vim.scroll to a particular value yourself.

Another issue that I found which can be seen at the end of the video, when scrolling back up to the top of the file using , the cursor seems to stop wherever it ended up when the scroll bar reaches the top of the file. If I'm not mistaken, the behaviour used to be that the cursor would continue going up all the way to the first line as long as you kept using (which also appears to be the behaviour in Vim).

I believe this is an issue with smooth scrolling. IIRC, someone tried to fix this a while back but came to the conclusion that there was a race condition so we couldn't, really. I'll take a look though. Nevermind. I don't think we can make this perfect, as the cursor should remain on the same line relative to the viewport even when you hold <C-d>, but we can make this much better.

Edit: this should work well now on master, even with smooth scrolling (unless you hold it or tap it very quickly, but I don't think this is fixable as of now).

J-Fields added a commit that referenced this issue Oct 21, 2019
It will still drift if you hold `<C-d>`, but I don't think this is fixable at the moment because we don't know when the scrolling has finished.
Refs #4179
@J-Fields
Copy link
Member

Closing this issue as it appears fixed

@spacepluk
Copy link

This is broken again.

@J-Fields
Copy link
Member

J-Fields commented Jan 8, 2020

@spacepluk Please make sure you're on 1.12.4. What's the behavior you're seeing, exactly?

@spacepluk
Copy link

@J-Fields Nevermind, it was just that the behavior is different from vim when there are closed folds and I got confused. Sorry for the noise.

@J-Fields
Copy link
Member

J-Fields commented Jan 9, 2020

@spacepluk No worries. I have folds disabled so I'm not sure exactly what the misbehavior is when there are closed folds. Feel free to submit an issue, but as the VSCode API doesn't provide us information about folds, there is likely nothing we can do at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants