Skip to content

Windows and Linux text navigation shortcuts treat newline and wordwrap differently #90993

Closed

Description

@justinmc

On native Windows, shift + home/end will navigate between wordwrapped lines, but not between lines that begin with a newline character. On Linux, shift+home/end doesn't move between lines at all, whether wordwrap or newline. On Flutter, we move between lines regardless of wordwrap or newline.

Native Windows

_Untitled.-.Notepad.2021-09-29.15-03-01.mp4

Flutter on Windows

Screen.Recording.2021-09-29.at.2.57.46.PM.mov
Code
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: const Center(
        child: TextField(
          maxLines: null,
        ),
      ),
    );
  }
}
flutter doctor -v
[✓] Flutter (Channel windows-shortcuts-missing, 2.6.0-12.0.pre.151, on macOS 11.6 20G165 darwin-x64, locale en-US)
    • Flutter version 2.6.0-12.0.pre.151 at /Users/jmccandless/Projects/flutter
    • Upstream repository [email protected]:justinmc/flutter.git
    • Framework revision b96a131df6 (9 minutes ago), 2021-09-29 15:17:55 -0700
    • Engine revision c9f8cb94ec
    • Dart version 2.15.0 (build 2.15.0-162.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/jmccandless/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 12.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.60.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.24.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.6 20G165 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 94.0.4606.61

! Doctor found issues in 2 categories.

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Sep 29, 2021
  2. Seirdy commented on Dec 10, 2021

    @Seirdy

    Confirming this issue on Linux; home/end navigate to the beginning/end of the entire text block, not the current line.

  3. self-assigned this
    on Jan 8, 2022
  4. github-actions commented on Feb 25, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions