Skip to content

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

@justinmc

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 git@github.com: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.

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